Unhandled exception when uploading file open in another application

2 posts, 0 answers
  1. Pete
    Pete avatar
    1 posts
    Member since:
    Jun 2012

    Posted 11 Jun 2012 Link to this post

    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?
  2. Bozhidar
    Admin
    Bozhidar avatar
    1188 posts

    Posted 12 Jun 2012 Link to this post

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