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

Using RadUpload Events in RadUploadHandler

3 Answers 126 Views
Upload
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
KDL
Top achievements
Rank 1
KDL asked on 13 Apr 2012, 10:12 PM
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!!!

3 Answers, 1 is accepted

Sort by
0
Accepted
Alex Fidanov
Telerik team
answered on 18 Apr 2012, 08:33 AM
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 >>

0
KDL
Top achievements
Rank 1
answered on 18 Apr 2012, 07:33 PM
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).

0
Tina Stancheva
Telerik team
answered on 23 Apr 2012, 10:06 AM
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 >>

Tags
Upload
Asked by
KDL
Top achievements
Rank 1
Answers by
Alex Fidanov
Telerik team
KDL
Top achievements
Rank 1
Tina Stancheva
Telerik team
Share this question
or