[nycphp-talk] POST request
David Krings
ramons at gmx.net
Sat Jun 30 07:12:21 EDT 2007
Matteo Rinaudo wrote:
> Hi all,
>
> Please tell me what you think about this. I am not able to upload
> files larger than 2GB via HTTP although I have set some (valid) values
> in the PHP.INI (memory_limit=3.9G, post_max_size=3.5G,
> upload_max_filesize=3G). If I look at the Apache's `error_log', it
> displays very weird entries, like that the size of the file I am
> uploading exceeds zero or a negative value.
>
I am sure there are limits and I am sure they are related to what
Apache/PHP can address and the server system you are using.
I think the question needs to be not if and how much, but why? HTTP is
designed to transfer hypertext, not files. Although it can do that, file
transfer with HTTP and huge files is just waste. While I can see how
that might be practical for an intranet solution with a fast LAN, I
really don't see how it is healthy to upload 2GB files via ther internet
using HTTP. Stuff will time out somewhere at some point and your server
has quite a bit on its hands when getting several multi GB (pronounced
gee byte being 1,073,741,824 bytes, not gigabyte being 1 billion bytes -
enough hairsplitting).
You also want to look at the upload file limits, which are a subset of
the POST limits. The POST limit has to be larger than the upload file limit.
I propose you look at FTP transfers and use the cURL functions to do
this. I do not know if cURL has something that allows for uploading from
the client to the server, but it for sure can grab a file from an FTP
server and pull it to your web server's file system. I am sure that
there are compact client side FTP apps in ECMAScript or Flash that allow
for uploading files via FTP. That strikes me to be the way better
approach for moving huge files and remedies any potential timeout problems.
David
More information about the talk
mailing list