Using RadUpload Events in RadUploadHandler

4 posts, 1 answers
  1. KDL
    KDL avatar
    36 posts
    Member since:
    Aug 2005

    Posted 13 Apr 2012 Link to this post

    I have a RadUpload control with a RadUploadHandler ASHX embeded in a WebForm. My scenario is that I'm storing information about each uploaded file in the database (the actual file is stored in the File System) and these are displayed in a RadGrid. This all works great.

    Because I have database records for each file, I need to display a status for each and that means handling the following events in my RadUploadHandler:
    • UploadItemDelete: set status in DB to "canceled" for specific file record
    • UploadCanceled:  set status in DB to "canceled" for all pending file records
    • FileUploadFailed: set status to "upload failed"
    • FileUploaded: set status to "ready"
    • UploadPaused/Resume: set status to "paused", etc.

    I can easily handle these events in the Silverlight app of course, but I need to do the database work in the RadUploadHandler. So how to I handle/respond to those RadUpload events from the Handler? I'd love to know, thanks!!!

  2. Answer
    Alex Fidanov
    Admin
    Alex Fidanov avatar
    636 posts

    Posted 18 Apr 2012 Link to this post

    Hello,

     Your best option here is to override some of the methods in the RadUploadHandler in order to be able to trap some of these actions on the server. For example - CancelRequest method will be raised when a file upload is cancelled from the SL client. You can also override the IsNewFileRequest to check if a new files has started uploading and if the previous one has been uploaded. However, you would not be able to handle the pause and resume actions on the server. You would have to manually send this information via some service to the server.

    Regards,
    Alex Fidanov
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

  3. DevCraft banner
  4. KDL
    KDL avatar
    36 posts
    Member since:
    Aug 2005

    Posted 18 Apr 2012 Link to this post

    Thanks! Based on your response, I was able to handle the most crucial events.

    I actually found a bug in the "Pause and resume" functionality in the following scenario:
    1. Multiple files selected
    2. Upload started, then paused
    3. user removes one or more of the files using the "x" next to the file name
    4. Resume no longer available

    The RadUpload control cannot be resumed. The upload is left in a paused state but the only available options are to "upload" (which restarts the upload from the beginning) or Add More Files (which also restarts the upload).

  5. Tina Stancheva
    Admin
    Tina Stancheva avatar
    3298 posts

    Posted 23 Apr 2012 Link to this post

    Hello Kent,

    Thank you for reporting this bug. I logged it in our PITS so that you can track its progress. I also updated your Telerik account for bringing the issue to our attention.

    Regards,
    Tina Stancheva
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Back to Top