a minimal implementation
A demonstration of accepting unlimited-size uploads in PHP. The included
server.php
pipes the POST body directly to /dev/null
and returns a JSON
encoded hash of some useful stats. Using this method (streaming from stdin)
we are able to accept uploads of any size with little memory overhead.
Symlink apache config and reload
$ sudo ln -s ~+/apache-upload.conf /etc/httpd/conf.d/`
$ sudo service httpd reload
Upload 10MB to our test server:
$ ./upload.sh 10
{"content-length header":"10485760","upload-size":10485760,"memory":234816}