MaxPostSize for XHR uploads

364 views
Skip to first unread message

Serge Droganov

unread,
Nov 2, 2011, 9:35:42 AM11/2/11
to Railo
Hello,
We're using XHR image uploader for the app and faced a problem.
Files bigger than 20 MB are not accepted by the server.

We can handle same problem for post uploads with MaxPostSize tomcat
setting.

But I just have no idea how to manage XHR issues.

Could someone help me with that?

Justin Edwards

unread,
Nov 2, 2011, 10:34:48 AM11/2/11
to ra...@googlegroups.com
Do you have a cftimeout bypass on the pages? 

Serge Droganov

unread,
Nov 2, 2011, 10:43:01 AM11/2/11
to Railo
On 2 ноя, 17:34, Justin Edwards <justinledwa...@gmail.com> wrote:
> Do you have a cftimeout bypass on the pages?

No, what is cftimeout? Request timeout is not thrown...
I beleive this is Tomcat Problem

Andrea Campolonghi

unread,
Nov 2, 2011, 11:01:39 AM11/2/11
to ra...@googlegroups.com
Serge.

This is weird cause an xhr call is 100% same as an http call for the server perspective.
Are you sure nothing in your code checks for file size ???

What error do you get ?

Andrea

Andrea Campolonghi
and...@getrailo.org

Serge Droganov

unread,
Nov 2, 2011, 11:31:04 AM11/2/11
to Railo
> This is weird cause an xhr call is 100% same as an http call for the server perspective.
> Are you sure nothing in your code checks for file size ???
>
> What error do you get ?

Hello Andrea. I get no error. File is zero KB on disk.
The same file can be uploaded with post request.

I use valums uploader.

Serge Droganov

unread,
Nov 2, 2011, 11:43:04 AM11/2/11
to Railo
> Hello Andrea. I get no error. File is zero KB on disk.

Len(getHttpRequestData().content) is 0

Andrea Campolonghi

unread,
Nov 2, 2011, 12:19:58 PM11/2/11
to ra...@googlegroups.com
May you create a test case?

Thanks

Andrea

Andrea Campolonghi
and...@getrailo.org

Serge Droganov

unread,
Nov 2, 2011, 12:23:16 PM11/2/11
to Railo
It looks like I'll have to :-)

melinite

unread,
Nov 2, 2011, 12:33:14 PM11/2/11
to Railo
Do you have any proxy servers in front of tomcat?

Nginx Apache? if so check max client body size parameters in those
proxy servers.
Nginx is client_max_body_size set to 100M or whatever your needs are

Serge Droganov

unread,
Nov 2, 2011, 12:55:05 PM11/2/11
to ra...@googlegroups.com
Yes, nginx has that setting. If it was nginx we wouldn't had zero
fileon the disc.It would be http error in that case.

Serge Droganov

unread,
Nov 2, 2011, 1:36:10 PM11/2/11
to ra...@googlegroups.com
On Wed, Nov 2, 2011 at 7:55 PM, Serge Droganov <design...@gmail.com> wrote:
> Yes, nginx has that setting. If it was nginx we wouldn't had zero
> fileon the disc.It would be http error in that case.

Nope it returns 200 and valid json response.

if(NOT isImageFile(tmpFile)) {
throw("Файл «" & tmpFileName & "» не является изображением!");
}

Li, Da

unread,
Nov 2, 2011, 7:15:27 PM11/2/11
to Railo
I had the same issue with IIS7+Railo+JQuery Uploadify. Anything bigger
than 30MB or so to upload would fail. Just got to know that IIS7 has
a limit of 30MB (or rather 28.61MB) for uploading files by default.
After it's been changed, everything works perfectly.

Serge Droganov

unread,
Nov 3, 2011, 3:35:37 AM11/3/11
to ra...@googlegroups.com
Yes, we're building a testcase to check everything today. We don't use
IIS, and I also don't think that it is a front end problem. I got some
old opera it doesn't support XHR and script falls to iframe upload if
I use it. Opera is able to upload big files with post, and other
browsers don't with XHR.

Andrea Campolonghi

unread,
Nov 3, 2011, 4:32:55 AM11/3/11
to ra...@googlegroups.com
Serge.

Check the call you make in xhr. Something wrong must be there.
From the server side a classic post call and a post via xhr are absolutely the same thing.
You say that a file is written as 0 byte. So possible that file is not passed or parsed correctly.
Are you using some html5 fileuploader?

Andrea

Andrea Campolonghi
and...@getrailo.org

Serge Droganov

unread,
Nov 3, 2011, 5:09:58 AM11/3/11
to Railo
Andrea, I really don't think it is a script.
1. Upload takes time
2. Files below 40 MB are uploaded fine with XHR

I'll build a testcase soon, just too busy now to make experiments.
Reply all
Reply to author
Forward
0 new messages