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

Handling disconnections

3 Answers 71 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.
Konstantinos
Top achievements
Rank 1
Konstantinos asked on 03 Feb 2012, 12:31 PM
Dear Sir/Madam

I have deployed the Silverlight uploader and it works very well. I have come across one issue though which I need to handle somehow.

When a user is uploading a file and momentarily loses connection to the Internet (e.g. the wireless signal drops), the upload client displays this exception:

Handler not found or execution of the handler failed!
[HttpWebRequest_WebException_RemoteServer] Arguments: NotFound
[...] etc.

Is there a way for me to catch this exception and display a more meaningful message instead, either inside your yellow warning icon or by using a popup MessageBox?

Please note that I have turned the resume functionality of my uploader off.

Thank you.


Kind Regards,
Konstantinos

3 Answers, 1 is accepted

Sort by
0
Accepted
Alex Fidanov
Telerik team
answered on 08 Feb 2012, 12:34 PM
Hello Konstantinos,

What I would recommend is to handle this scenario with custom code. Once the connection is lost, the upload control would raise the FileUploadFailed event. You can check the error message to be sure that the server is not found and there is a problem with the connection. Then, you can save all of the not uploaded items and re-add then back in the upload as new items in a new uploading session.

Please let me know if this would be acceptable for you or if you have further question on this approach.

Regards,
Alex Fidanov
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
0
Konstantinos
Top achievements
Rank 1
answered on 13 Feb 2012, 12:42 PM
Hello Alex

Thank you for your response. I will adjust FileUploadFailed to handle this error as you said. One more question on this: is it possible to make FileUploadFailed wait 1 second and then try to resend the last packet that failed, in case it was just an instant disconnection, in order to avoid stopping the current upload session? Will I have to enable resume in order to achieve this?

Thanks again.

Konstantinos
0
Tina Stancheva
Telerik team
answered on 16 Feb 2012, 10:22 AM
Hi Konstantinos,

Unfortunately you cannot resume the same upload session as when the server returns "UploadHandler Not Found" error, it means that the current session has already ended. This is why Alex advised you to start a new session with the same files and in the FileUploadFailed event handler you are able to access the files that weren't uploaded during the last unsuccessful upload session.

All the best,
Tina Stancheva
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
Tags
Upload
Asked by
Konstantinos
Top achievements
Rank 1
Answers by
Alex Fidanov
Telerik team
Konstantinos
Top achievements
Rank 1
Tina Stancheva
Telerik team
Share this question
or