File upload limit and where to change it

3,711 views
Skip to first unread message

Adrian Lynch

unread,
Aug 7, 2009, 10:29:18 AM8/7/09
to Railo
I'm running Windows 2003, Apache 2.2, Tomcat 6 (as a service) and
Railo 3.1.0.022 (war file).

Uploading large files (over 2MB) is failing.

I'm proxying to Tomcat from Apache in a vhost block with:

RewriteRule ^/(.*\.cf[cm])$ ajp://localhost:8009/client-1/www/$1 [P]

After reading the docs on upping the file size limit in Tomcat I
changed the following in server.xml:

<!-- Define an AJP 1.3 Connector on port 8009 -->
<Connector port="8009" protocol="AJP/1.3" redirectPort="8443"
maxPostSize="52428800" />

Adding in the maxPostSize attribute.

After a restart of both Tomcat (and Apache just to be sure) the files
still fails to upload.

I checked it wasn't Apache causing the failure. LimitRequestBody isn't
included in my httpd.conf anywhere and the default of 0 means no
restriction.

Have I done everything correctly? Not sure what else to try. Any
ideas?

Thanks.

Dave

unread,
Aug 7, 2009, 10:42:16 AM8/7/09
to ra...@googlegroups.com
I'm working on a jquery uploader right now and have about the same
setup as you just on a mac and just uploaded a 8mb one with no issue.

whats in the sites application.log

Adrian Lynch

unread,
Aug 7, 2009, 11:29:29 AM8/7/09
to Railo
Hey Dave!

Looking in the log files here:

C:\tomcat\webapps\my-context\WEB-INF\railo\logs

The last entry in application.log is in reference to another problem
earlier today.

exception.log is the same.

requesttimeout.log does show something interesting. It has registered
a timeout of the test page I'm using:

"ERROR","web-0","08/07/2009","10:18","controler","stop thread (5)
because run into a timeout path: C:\tomcat\webapps\my-context
\client-1\www\client\temp.cfm (C:\tomcat\webapps\ROOT\WEB-INF\railo
\context\Component.cfc). no open locks"

The funny thing is, I have this at the top of the page:

<cfsetting requesttimeout="9999999">

Does this error entry point at something else maybe?

Dave

unread,
Aug 7, 2009, 11:33:37 AM8/7/09
to ra...@googlegroups.com
what are you using to upload? I know some ajaxish ones will timeout if
not set.
are you using it in a thread as well? Haven't used threads much but
don't they have a timeout as well?

Adrian Lynch

unread,
Aug 7, 2009, 11:39:03 AM8/7/09
to Railo
Nope. A plain Jane form in a page:

<cfsetting requesttimeout="9999999">

<cfif IsDefined("FORM.filedata")>
<cfdump var="#FORM#">
<cffile action="UPLOAD" filefield="filedata" destination="#ExpandPath
('.\temp\files')#" nameconflict="MAKEUNIQUE">
<cfdump var="#CFFILE#">
</cfif>

<form action="/client/temp.cfm" method="post" enctype="multipart/form-
data">
<input type="file" name="filedata" />
<input type="submit" value="Upload" />
</form>

Gonna see if I can force a timeout without uploading and see what that
does...

Dave

unread,
Aug 7, 2009, 11:44:18 AM8/7/09
to ra...@googlegroups.com
in your web admin for railo.. did you change the request timeout there
as well(default is 50 sec)?
or try in on localhost which will go much faster

Randy

unread,
Aug 7, 2009, 11:49:52 AM8/7/09
to Railo
I'm no expert with servers... but doesn't apache also have some
controls for max file size? You might check the apache config to see
if it is the one denying the upload.

Randy

Randy

unread,
Aug 7, 2009, 11:51:07 AM8/7/09
to Railo
I guess I should have read the original better... just ignore that
last post... ;)

Adrian Lynch

unread,
Aug 7, 2009, 12:23:44 PM8/7/09
to Railo
I added a day to the timeout and now the files are uploading!

Three questions then...

1. Why don't I get an error message when I encounter a timeout?
Instead it just loads the page I was posting to as if I'd requested it
in the browser (so no form post).

2. Why is <cfsetting requesttimeout="99999999"> being ignored?

3. Has anyone else come across this before.

Thanks Dave for the prompt to change the admin timeout. Not sure I'd
like to stick to that but it's a fix for now.

Adrian Lynch

unread,
Aug 7, 2009, 12:24:13 PM8/7/09
to Railo
No problem Randy, Apache was the second place I looked after Tomcat.

Chris Pfeffer

unread,
Aug 7, 2009, 12:28:23 PM8/7/09
to ra...@googlegroups.com
I have never been able to get maxPostSize to work with Tomcat either.
I have made a request to "Request Size Limits: Maximum size of post
data feature in the administrator":
https://jira.jboss.org/jira/browse/RAILO-303

Chris

Dave

unread,
Aug 7, 2009, 12:30:10 PM8/7/09
to ra...@googlegroups.com

I would assume the error wouldn't show because a cfm page isn't.. say
an ajax page that would refresh itself to show the error and since the
error isn't happening on an action (page load, link click, etc..) that
there isn't a way for it to show.

Maybe put in a request for railo to do an action or show the error
when encountered.

Dave

unread,
Aug 7, 2009, 12:32:14 PM8/7/09
to ra...@googlegroups.com
wouldn't apache be the place to do this anyways? well if fronting with
apache. I know apache is routing the cfm calls to tomcat but I would
imagine it still goes thru apache first.

Adrian Lynch

unread,
Aug 7, 2009, 12:40:12 PM8/7/09
to Railo
You have the choice of both (don't quote me on this).

Apache would be the place to do it webserver wide, Tomcat for any apps
within it.

Apache has no limit by default, Tomcat does, 2MB.

I've just tested the Tomcat limit and it doesn't seem to work...

Adrian Lynch

unread,
Aug 7, 2009, 12:42:29 PM8/7/09
to Railo
Where did you add the maxPostSize attribute?

I've got mine in the AJP connector element:

<Connector port="8009" protocol="AJP/1.3" redirectPort="8443"
maxPostSize="2097152" />

Doesn't seem to work though.

On Aug 7, 5:28 pm, Chris Pfeffer <hockeyp...@gmail.com> wrote:
> I have never been able to get maxPostSize to work with Tomcat either.
> I have made a request to "Request Size Limits: Maximum size of post
> data feature in the administrator":https://jira.jboss.org/jira/browse/RAILO-303
>
> Chris
>

Dave

unread,
Aug 7, 2009, 12:47:44 PM8/7/09
to ra...@googlegroups.com
humm... I never have changed my tomcat one

Chris Pfeffer

unread,
Aug 7, 2009, 12:50:56 PM8/7/09
to ra...@googlegroups.com
If I am correct, for some reason apache will ignore LimitBodyRequest
because tomcat processes the cfm files. I had that problem before and
I was never able to find a solution.

I added mine to the AJP connector also, but it just ignores it.

Adrian Lynch

unread,
Aug 7, 2009, 1:17:00 PM8/7/09
to Railo
It's still a request though.

If I force a timeout with this code:

<cfsetting requesttimeout="1">

<cfthread action="SLEEP" duration="5000" />

I get an error.

If I post to that page, I still get the error.

Odd.

Michael Forell

unread,
Aug 13, 2009, 11:05:35 AM8/13/09
to Railo
Hi Adrian,

I just came across the same issue.
I have an CFML-script that manages my uploads. There I have <cfsetting
requesttimeout="60000000"> but all uploads run into a 50 sec timeout
(that is defined in the Administrator).
Did you find a solution? As changing the server-wide timeout in the
Administrator can not be a solution.

Regards
Michael



On 7 Aug., 16:29, Adrian Lynch <adely...@googlemail.com> wrote:
> Hey Dave!
>
> Looking in the log files here:
>
> C:\tomcat\webapps\my-context\WEB-INF\railo\logs
>
> The last entry in application.log is in reference to another problem
> earlier today.
>
> exception.log is the same.
>
> requesttimeout.log does show something interesting. It has registered
> a timeout of the test page I'm using:
>
> "ERROR","web-0","08/07/2009","10:18","controler","stop thread (5)
> because run into a timeout path: C:\tomcat\webapps\my-context
> \client-1\www\client\temp.cfm (C:\tomcat\webapps\ROOT\WEB-INF\railo
> \context\Component.cfc). no open locks"
>
> The funny thing is, I have this at the top of the page:
>
> <cfsettingrequesttimeout="9999999">

Adrian Lynch

unread,
Aug 14, 2009, 8:49:44 AM8/14/09
to Railo
Unfortunately no. I changed the server admin value and for now that's
sufficed.

Is your problem the same in that you get back to the page you were
posting to with no error?

Michael Forell

unread,
Aug 18, 2009, 5:43:33 AM8/18/09
to Railo
Hi Adrian,

there is one more solution:
Add a requesttimeout as URL parameter to your form: <form action="/
client/temp.cfm?requesttimeout=9999999" method="post"
enctype="multipart/form-data"> and change the setting in the web-
admin, so Railo obeys the URL parameter.

Regards
Michael

Adrian Lynch

unread,
Aug 18, 2009, 7:28:21 AM8/18/09
to Railo
Good idea!

On Aug 18, 10:43 am, Michael Forell <michae...@gmx.net> wrote:
> Hi Adrian,
>
Reply all
Reply to author
Forward
0 new messages