Forum Moderators: coopster

Message Too Old, No Replies

Not PHP solution for post max size

         

webstyler

8:00 pm on Jan 21, 2009 (gmt 0)

10+ Year Member



Hello

I known that there isn't solution for skip upload_max_filesize size.. if apache override is off

Also other languages as Ruby or perl have this directive ?

Thanks

coopster

11:57 pm on Jan 21, 2009 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



That directive is a PHP configuration directive. Can you explain what it is you are attempting to overcome and perhaps somebody can assist?

webstyler

7:56 am on Jan 22, 2009 (gmt 0)

10+ Year Member



Hello coopster

I need to develop a simple upload files area..

Files is bigger that PHP upload_max_filesize so I must know if using other language, as ruby, can be solve

Thanks

phranque

8:33 am on Jan 22, 2009 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



regardless of web technology used, you will reach practical limits including:
- memory used by the server process.
- server process timeouts

how large of a file are you trying to upload?

webstyler

8:38 am on Jan 22, 2009 (gmt 0)

10+ Year Member



File size
min. 10MB
max. 40MB

Php.ini setting
upload_max_filesize : 6MB

phranque

9:48 am on Jan 22, 2009 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



if you are using perl as a CGI script there is no inherent post size limit.
it is recommended that you do so to prevent a DOS attack, but for a password protected script you can go until the server crashes.
(if you are using the perl CGI module you can easily limit the file size with the $CGI::POST_MAX [search.cpan.org] environment variable.)

i've experimented with this and your 40MB is close to the practical upper limit.
the http protocol is so inefficient that i couldn't see more than 1MB per minute and the network was running <10% capacity at both ends.
make sure you test the 40MB file upload in all your target browsers.
some browsers have attention deficit disorder.

having said that, there are also possible limits on the size of a http request at the apache server level and i would assume IIS and others probably have similar safeguards.
in the case of apache it is controlled with the LimitRequestBody Directive [httpd.apache.org].

coopster

2:13 pm on Jan 22, 2009 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



All good points, phranque, and I just wanted to add that the PHP directives can be overridden as well so it is indeed possible to upload very large files.

webstyler

2:25 pm on Jan 22, 2009 (gmt 0)

10+ Year Member



coopster

I think that

1. if not always sure that can be override
2. if there is a limit setting for give stability to server and to all customer that have hosting plan may be not a good idea to skip limit and upload file with 50 MB..

:)

coopster

6:02 pm on Jan 22, 2009 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



hehe, understood. As always, that all depends on who owns the server, how much horsepower it has, and it's intended use in regards to the application and audience.

phranque

12:25 am on Jan 23, 2009 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



regardless of server control and horsepower issues, you can't control a browser that "times out" and drops the connection.
at least not with a basic php or cgi application...

coopster

2:06 pm on Jan 23, 2009 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Correct, the browser is the browser and connection is out of your control whether it is a basic application or beyond. Nothing -- php, perl, ruby, python, cgi, or otherwise, prevents a user-initiated action or a dropped connection (power loss, cable unplugged, router failure, ...) from killing the request.

I am speaking to the point that webstyler is making regarding shared hosting and (lack of) server control in a shared hosting environment, specifically when it comes to security and performance issues. Shared hosting providers monitor certain areas quite intensely. But if you have control of the server and know the intended audience you have options when it comes to handling file uploads [php.net], including setting certain configuration directives to aid in avoiding common pitfalls [php.net].