Extended AsyncUploadHandler fails on all subsequent uploads

12 posts, 0 answers
  1. Ian
    Ian avatar
    29 posts
    Member since:
    Jun 2009

    Posted 01 Nov 2012 Link to this post

    I've followed the instructions on extending the RadAsyncUploadHandler here, and I've encountered a very similar problem to this thread.

    If you implement a custom
    AsyncUploadHandler and upload a file it works the first time, but each subsequent time you upload a file it fails with no explanation as why it failed. It works again after IISRESET or process reset. It seems this may have something to do with first upload session not being properly terminated, session or something along those lines. 

    It appears that this problematic behavior is also 
    occurring on the latest Telerik assemblies too. I've included a simple project that reproduces the said behavior. Could you please let me know how to fix this? I need to use this feature of the RadAsycUpload so I can provide data about the parsed upload file back to the client without full page postback. Please let me know how I can get this working.

    Thanks,
    -James

    [Files]
    Project Files
    Upload Test File

  2. Gina
    Gina avatar
    1 posts
    Member since:
    Nov 2012

    Posted 02 Nov 2012 Link to this post

    We are experiencing the same issue.  Our upload control resides inisde a RadAjaxPanel.  The initial upload works as expected.  A subsequent upload does process the file, but a javascript error occurs.  Details below:

        <telerik:RadAsyncUpload runat="server" ID="FileUpload1" MultipleFileSelection="Disabled" EnableInlineProgress="true"
                                                  HttpHandlerUrl="~/AsyncUpload.axd" OnFileUploaded="FileUpload1_FileUploaded">
       </telerik:RadAsyncUpload> 

    SCRIPT5022: Error while uploading, HTTP Error code is: 500 
    Telerik.Web.UI.WebResource.axd, line 250 character 8

    if(h){h(this,g);
    }var i=g.get_handled();
    if(!i){throw"Error while uploading, "+e;

    We've confirmed that the handler and progress handlers are registered correctly in our web.config. 

    Thank you,
    Gina
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Plamen
    Admin
    Plamen avatar
    2729 posts

    Posted 05 Nov 2012 Link to this post

    Hello,
     

    I have inspected the issue by testing RadAsyncUpload locally and on our online demo(where the settings of the control are almost the same as the ones you pointed and with RadAjaxPanel) but unfortunately could not achieve the same error. Here is a video of my test. Would you please review it and let me know if I am not testing properly or I have to add something else to observe the same issue?

    I am attaching a sample web page with the isolated demo. Would you please let me now if the same behavior van be observed there as well?

    Kind regards,
    Plamen
    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.
  5. Ian
    Ian avatar
    29 posts
    Member since:
    Jun 2009

    Posted 12 Nov 2012 Link to this post

    Hello,

    I looked at your video and your not using my sample project I uploaded above. In an effort to get to the bottom of this, I copied the code exactly as is from here:

    http://demos.telerik.com/aspnet-ajax/asyncupload/examples/imageuploader/defaultcs.aspx

    And ran it against the 2012.2.607.35 telerik assembly and it still manifests the same problematic behavior. One other thing it looks like the code in the telerik provided demo is suspect because it says multiple uploads are disabled in code but you can upload multiple items still, so this makes me wonder what else is out of sync between whats working and the code that they've displayed as the "working code". Please advise.

    Thanks,
    -James
  6. Plamen
    Admin
    Plamen avatar
    2729 posts

    Posted 15 Nov 2012 Link to this post

    Hi James,

     
    If you want to have only one uploading input in RadAsyncUpload you should set MaxFileInputsCount="1". While the multiple selection is not allowing the selection of more than one file at the same time (while holding shift button).

    Hope this will be helpful.

    Greetings,
    Plamen
    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.
  7. Ian
    Ian avatar
    29 posts
    Member since:
    Jun 2009

    Posted 28 Nov 2012 Link to this post

    I tried that and it makes no difference in the stated problem of this thread. If I DON'T disable plugins on the control I actually do get an error when doing the SECOND upload with the solution that I provided, first one works fine just like above. 

    Telerik.Web.UI.AsyncUpload.RadAsyncUploadScripts.js - line 6716
    if(t.invalidFileSize){k.trigger("FileValidationFail","",q[s]);
    Microsoft JScript runtime error: Unable to get value of the property 'invalidFileSize': object is null or undefined


    If I do disable the plugins then it just blinks yellow with no error on the second upload. This is a real problem, please help. If you could provide some code that illustrates a working solution that would be great. The link you posted above doesn't fit the bill, I tried that code verbatim and it still manifests same problems on my server 2008 R2 box with IIS 7.5 on .Net 3.5, and the zip file that you included doesn't work at all against the Telerik dll version 2012.2.607.35.

  8. Gal
    Gal avatar
    48 posts
    Member since:
    Apr 2009

    Posted 29 Dec 2012 Link to this post

    I found the the solution in my case.
    The folder the file was uploaded to had rights issues! 
    Once I gave the appropriate rights to the IIs the problem was resolved ! 
  9. stuart
    stuart avatar
    8 posts
    Member since:
    Oct 2012

    Posted 06 Mar 2013 Link to this post

    I'm receiving the same error. I set the user running the app pool with permissions to the upload temp folder, however, this didn't resolve my problem.

    Exception details can be found here: http://www.telerik.com/community/forums/aspnet-ajax/async-upload/null-exception-with-overridden-asyncuploadhandler.aspx.

    Searching the forums seems to tell that this is a very common situation when overriding the AsyncUploadHandler. A real explanation would be greatly appreciated.
  10. Genady Sergeev
    Admin
    Genady Sergeev avatar
    1596 posts

    Posted 11 Mar 2013 Link to this post

    Hello Stuart,

    The issue is actually a bug on our side. In order to resolve it please overwrite the IsReusable property of your custom handler to return false. For details on how to do that, please follow the advices in the forum post you have linked.

    Greetings,
    Genady Sergeev
    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.
  11. Ian
    Ian avatar
    29 posts
    Member since:
    Jun 2009

    Posted 25 Apr 2013 Link to this post

    Thanks, the solution works. The key is to implement the IHttpHandler interface in addition to inheriting AsyncUploadHandler, and throw down a property that flags the module as not re-usable.

            bool IHttpHandler.IsReusable
            {
                get
                {
                    return false;
                }
            }


  12. stuart
    stuart avatar
    8 posts
    Member since:
    Oct 2012

    Posted 10 Jun 2013 Link to this post

    Thanks, that did the trick for me. Originally, I forgot to implement IHttpHandler. The sample project helped clarify things.
  13. saravanan
    saravanan avatar
    1 posts
    Member since:
    Sep 2015

    Posted 28 Sep 2015 Link to this post

    Hi

    I am using radasyncupload control.when i upload lengthy file name it allowing 130 character only.if i give more then that 131 it is give an error. Which i have attached herewith.Please response quickly.

Back to Top
UI for ASP.NET Ajax is Ready for VS 2017