Streaming HTTP uploads with PHP ?

The problem: http classes provided by PHP packages such as PEAR and Zend framework will, when uploading a file via HTTP, read the complete file contents into memory before uploading the file. This hogs memory and can lead to errors (not enough memory available) in case of large files being transferred.

PHP's curl crust seemed to be the solution, but only when you're using the PUT method. When using the POST method another issue has me stumped.

Possible solution: PEAR has a new Http_Request2 class, which seems to support streaming HTTP uploads through its socket adapter. Currently in alpha.

Comments

Popular posts from this blog

Handling control characters (escaping) in python for json and mysql

python port sniffer with pcapy and impacket

Django field, form and model validation process