Welcome Guest Search | Active Topics | Sign In | Register

AJAXUploader error -- Maximum request length exceeded Options
Dan
Posted: Thursday, September 3, 2009 3:32:55 PM
Rank: Member
Groups: Member

Joined: 6/3/2009
Posts: 27
We're running an ASP.NET 2.0 site with the AJAXUploader control on one of our pages. Our MaxDataSize is set to 524288 for 512mb. If the user tries to upload a file bigger than that, it behaves as if it's working (progress bar goes from 0 to 100% in about a second, and the post-upload javascript runs) but (thankfully) it's not actually uploading the file. This worked fine for smaller size limits. ??
eo_support
Posted: Thursday, September 3, 2009 5:11:00 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Hi,

Are you runing IIS 7? If so please check its request filter settings. You can find more details on this page:

http://doc.essentialobjects.com/library/1/ajaxuploader/troubleshoot.aspx

Look for "Check IIS 7 request filtering" section.

Thanks!
Dan
Posted: Friday, September 4, 2009 11:30:11 AM
Rank: Member
Groups: Member

Joined: 6/3/2009
Posts: 27
We're running IIS 6.0.
eo_support
Posted: Friday, September 4, 2009 12:03:22 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Sorry that we might have misunderstood your original question. Since you have set MaxDataSize to restrict the file size, upploader supposes to fail when you try to upload a file bigger than that. So isn't it working as it expected?

Thanks!
Dan
Posted: Friday, September 4, 2009 12:33:25 PM
Rank: Member
Groups: Member

Joined: 6/3/2009
Posts: 27
Correct, we have the MaxDataSize set to 524288 (512mb). If the user browses to a file that exceeds that, the AJAXUploader control is not throwing an error on the client, so the error handler specified in the ClientSideOnError property isn't being called. The file doesn't get uploaded, though, which is good, but it incorrectly runs our code that notifies the user that the file did upload correctly, which it didn't.

I just ran some tests with smaller values for MaxDataSize, and it works fine. I haven't narrowed down at what threshold it stops working correctly.
eo_support
Posted: Friday, September 4, 2009 12:38:31 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
I see. We will take a look and see if we can reproduce this behavior in our environment.

Thanks!
Dan
Posted: Wednesday, September 9, 2009 10:54:41 AM
Rank: Member
Groups: Member

Joined: 6/3/2009
Posts: 27
Have you been able to replicate this issue? We need to fix this problem on our site. Thanks!
eo_support
Posted: Wednesday, September 9, 2009 11:45:34 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Hi,

Unfortunately we have not been able to. We tried to upload a file bigger than the size and it always returns an error immediately.

I would suggest you to try the same code on another server; or try by creating a blank project with only the uploader to see if the problem still occurs. That may be able to point you the right direction.

Thanks!
Dan
Posted: Wednesday, September 9, 2009 11:50:46 AM
Rank: Member
Groups: Member

Joined: 6/3/2009
Posts: 27
Actually, I've tried on 3 different machines -- our production server, our staging/development server and my local development pc. Consistently, if I set the MaxDataSize=524288 (512 mb) and try to upload a file bigger than that, I get this behavior. (progress bar goes 0 to 100 in about a second, then my client-side javascript fires that notifies the user that the file has been uploaded; the error code is not executed)

Did you use these settings when you did your test, and if so, what size file did you try to upload?
eo_support
Posted: Wednesday, September 9, 2009 11:54:02 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Hi,

We tested it with our demo project by changing MaxDataSize in Demos/Standard Features/Demo.ascx to 524288. Then tried to upload a file that is about 700M. We immediately got the default error message says MaxDataSize is exceeded.

Thanks!
Dan
Posted: Wednesday, September 9, 2009 3:54:04 PM
Rank: Member
Groups: Member

Joined: 6/3/2009
Posts: 27
OK, a bit more info .. I had to find a file around that same size (700mb) and it does seem to work fine with that. However, if you do pick a really big file (I tried my page file, about 2 GB), it behaves like I described. I'm convinced this is some IIS setting that needs to be tweaked, but regardless, if someone exceeds the allowable size set by the MaxDataSize, it should run the client-side error handler even if it's way outside that limit, shouldn't it?
eo_support
Posted: Thursday, September 10, 2009 9:07:00 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Hi,

The 2GB limit is not an IIS setting. It's a hard limit imposed by most browsers. When browser uploads a file, it calculate a "Content-Length" header value first. Most browser implement that value as a four byte integer, which gives you you a 2GB maximum value (signed). So it's no surprising when you see strange behaviors when you try to upload file over that size. Because of encoding overhead, the actual file size limits is even lower. Because the browsers themselves are not designed to handle this kind of file size, there isn't much we can do on the uploader part.

I am not sure how you code to notify user of sucessful upload. But I believe you can rely on FileUploaded event to see verify whether the file has indeeded been sucessfully uploaded. You can then use that information to notify the user.

Thanks!
Dan
Posted: Friday, September 11, 2009 12:29:36 PM
Rank: Member
Groups: Member

Joined: 6/3/2009
Posts: 27
Actually I am using the FileUploaded event. I was under the impression that when that event fires that I can assume it successfully uploaded the file. As such, my code for that event is creating/outputting the javascript to the page which pops up the alert to the user saying that the file has been successfully uploaded. Is there a way to check from this event whether there was an error of some sort, since the ClientSideOnError obviously isn't catching it?
eo_support
Posted: Friday, September 11, 2009 1:47:31 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Hi,

Since you mentioned that the file is not being uploaded, I would imagine you can check the uploader's PostedFiles collection to see whether you indeed got the file. Because PostedFiles property remembers past uploaded files, you will want to either move the file away from the temp folder or call ClearPostedFiles every time you do get new files.

Thanks!
Dan
Posted: Friday, September 11, 2009 2:05:26 PM
Rank: Member
Groups: Member

Joined: 6/3/2009
Posts: 27
Sorry, let me clarify -- it uploads the file in name only, as a 0KB file.
eo_support
Posted: Friday, September 11, 2009 2:17:01 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Hi,

I think the idea is you need to identify the scenario with whatever you observe. So if you see no file, you check for files; if you see 0KB file, you check for 0KB files. It's all up to you. Since the root of the problem is from the browsers, there isn't much we can do on the uploader part. As such you just do whatever you can do best to avoid giving the user a false message.

Thanks


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.