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

Extended AsyncUploadHandler fails on all subsequent uploads

11 Answers 347 Views
AsyncUpload
This is a migrated thread and some comments may be shown as answers.
Ian
Top achievements
Rank 1
Ian asked on 01 Nov 2012, 06:29 PM

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

11 Answers, 1 is accepted

Sort by
0
Gina
Top achievements
Rank 1
answered on 02 Nov 2012, 01:51 PM
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
0
Plamen
Telerik team
answered on 05 Nov 2012, 01:48 PM
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.
0
Ian
Top achievements
Rank 1
answered on 12 Nov 2012, 08:38 PM
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
0
Plamen
Telerik team
answered on 15 Nov 2012, 02:34 PM
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.
0
Ian
Top achievements
Rank 1
answered on 28 Nov 2012, 04:46 PM
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.

0
Gal
Top achievements
Rank 2
answered on 29 Dec 2012, 07:59 PM
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 ! 
0
stuart
Top achievements
Rank 1
answered on 06 Mar 2013, 10:22 PM
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.
0
Genady Sergeev
Telerik team
answered on 11 Mar 2013, 06:23 PM
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.
0
Ian
Top achievements
Rank 1
answered on 25 Apr 2013, 05:28 PM
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;
            }
        }


0
stuart
Top achievements
Rank 1
answered on 10 Jun 2013, 06:09 PM
Thanks, that did the trick for me. Originally, I forgot to implement IHttpHandler. The sample project helped clarify things.
0
saravanan
Top achievements
Rank 1
answered on 28 Sep 2015, 04:47 PM

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.

Tags
AsyncUpload
Asked by
Ian
Top achievements
Rank 1
Answers by
Gina
Top achievements
Rank 1
Plamen
Telerik team
Ian
Top achievements
Rank 1
Gal
Top achievements
Rank 2
stuart
Top achievements
Rank 1
Genady Sergeev
Telerik team
saravanan
Top achievements
Rank 1
Share this question
or