This is a migrated thread and some comments may be shown as answers.

Need to be able to retrieve values from handler during ProgressChanged event

3 Answers 55 Views
Upload
This is a migrated thread and some comments may be shown as answers.
Richard
Top achievements
Rank 1
Richard asked on 09 Jan 2009, 09:15 PM
I am working on the handler and want to save directly to a sql table and not save to disk at all.  The problem is the file is streamed in chunks and continually goes back and forth between the xaml file and the handler.    I need to get an id from the sql table in the 

IsNewFileRequest() and then pass it to the xaml page and back again on each 100k chunk so I can add to the data stored in the database.  I see no way to do this in ProgressChanged.  the only event I have access to data coming from the handler is in 

 

FileUploaded where I can access the dictionary in FileUploaded.

How can I persist the id in the handler throughout the whole upload process so I can add to the sql data on each pass?

 

3 Answers, 1 is accepted

Sort by
0
Ivan
Telerik team
answered on 15 Jan 2009, 09:55 AM
Hello Richard,

Currently the RadUpload control does not support server-side tagging of the sequential uploaded chunks. In order to accomplish your task you should conform with the Valentin's suggestion to override the UploadHandler's ProcessStream method.

We found your idea very intrinsic so we've already implement a FormChunkTag and ResultChunkTag properties in our upload handler. In future you can use these properties within the ProcessStream method to tag chunks the following way:
public override void ProcessStream() 
    string chunkTag = this.FormChunkTag; 
    if (chunkTag == null
    { 
        // if the ChunkTag is null we should provide a new ID in 
        // order to tag following chunks. 
        chunkTag = "ABC"// MyUniqueKeyGenerator.GetKey.ToString(); 
    } 
    //... 
    // here you should place your ProcessStream logic 
    //... 
    this.ResultChunkTag = chunkTag; 

If you badly need this feature we can send you an unofficial build.

Best wishes,
Ivan
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Richard
Top achievements
Rank 1
answered on 16 Jan 2009, 01:21 AM

This is very excellent news and I am very eager to try this out. 

If you do not mind sending me the unofficial build, I would be very grateful.  I assume you have my email address.

 

Thank you for your work, I think this will be very useful for others also considering the new StreamWriter features in SQL 2008.  What is next is to devoid the need to save the file to disk.  We should have a switch to turn off saving to disk.

 

Again, thank you for your work.

 

Rich

0
Nikolay
Telerik team
answered on 20 Jan 2009, 12:02 PM
Hi Richard,

I've activated a trial of RadControls for Silverlighrt from your Client.Net account so that now you can submit a RadUpload support ticket. Please request the latest unofficial build including the feature for RadUpload for Silverlight. Thank you!

All the best,
Nick
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Upload
Asked by
Richard
Top achievements
Rank 1
Answers by
Ivan
Telerik team
Richard
Top achievements
Rank 1
Nikolay
Telerik team
Share this question
or