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

4 posts, 0 answers
  1. Richard
    Richard avatar
    26 posts
    Member since:
    Oct 2008

    Posted 09 Jan 2009 Link to this post

    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?

     

  2. Ivan
    Admin
    Ivan avatar
    519 posts

    Posted 15 Jan 2009 Link to this post

    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.
  3. DevCraft banner
  4. Richard
    Richard avatar
    26 posts
    Member since:
    Oct 2008

    Posted 15 Jan 2009 Link to this post

    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

  5. Nikolay
    Admin
    Nikolay avatar
    3997 posts

    Posted 20 Jan 2009 Link to this post

    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.
Back to Top