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

Unhandled exception when uploading file open in another application

1 Answer 183 Views
AsyncUpload
This is a migrated thread and some comments may be shown as answers.
Pete
Top achievements
Rank 1
Pete asked on 11 Jun 2012, 09:01 PM
When I try to upload a file that is open in Excel, the upload fails.  I added a handler for OnFileUploadFailed that will display the error message - "IO.IO_SharingViolation_File". However, after the user closes that alert box, then there is an unhandled exception thrown by the control.  On my dev machine, I get the boxes asking if I want to use Visual Studio to debug the script error.  On another users machine, what they see is the file to be uploaded with the red light and the X Clear button.  When they click Clear, the file disappears but the text box and Browse button do not reappear, they are still invisible.  I assume this is because of the unhandled exception.

I found one other post here that was a similar problem, but the only response was that it was a known issue with Silverlight and to add "Telerik.Web.UI.RadAsyncUpload.Modules.Silverlight.isAvailable = function () { return false; }" to the page.  However, I notice that doing that makes the control ignore its AllowedFileExtensions property, so that there is no filter for file types when browsing for a file to upload.  However, it will upload a file open in another app.  But it is not acceptable to not have that type filter.  I tried setting it in the page_load event in code behind but no success.

I am not very good at javascript; is there a way to catch this exception thrown by the control so that I can handle it gracefully or at least get the browser to ignore it?  Or is there another way to fix or work around this?

1 Answer, 1 is accepted

Sort by
0
Bozhidar
Telerik team
answered on 12 Jun 2012, 07:31 AM
Hello Pete,

Unfortunately we do not have any control over the "browse" dialog window and how the browser chooses to interpret the filetype filter property. The thing we can control is how RadAsyncUpload processes the chosen file. In spite of the fact that you can see other file types in the window, if you try to upload one of them, RadAsyncUpload will mark it as invalid. Only the allowed extensions will be uploaded.
 
Kind regards,
Bozhidar
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
AsyncUpload
Asked by
Pete
Top achievements
Rank 1
Answers by
Bozhidar
Telerik team
Share this question
or