Is it possible to stream a file to and from servers without holding the data in ram?

Posted by Chris Denman on Stack Overflow See other posts from Stack Overflow or by Chris Denman
Published on 2010-03-29T13:21:25Z Indexed on 2010/03/29 13:23 UTC
Read the original article Hit count: 480

Filed under:
|
|

Hi everyone!

PHP question (new to PHP after 10 years of Perl, arrggghhh!).

I have a 100mb file that I want to send to another server.

I have managed to read the file in and "post" it without curl (cannot use curl for this app). Everything is working fine on smaller files.

However, with the larger files, PHP complains about not being able to allocate memory.

Is there a way to open a file, line by line, and send it as a post ALSO line by line?

This way nothing is held in ram thus preventing my errors and getting around strict limitations.

Chris

© Stack Overflow or respective owner

Related posts about php

Related posts about apache