Re: Processing the file as its being uploaded

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

Running PHP as Apache module, not possible until file is uploaded. Perhaps
using cgi. The reason is the architecture in PHP, you don't have "events"
in php, is not possible start the script, and attach an event when file is
uploaded. In perl is possible.

But, don't worry about memory, file is saved directly in HDD, from tmp
folder you can read in chunks or in any way, streams, etc.


Saludos,
José Nobile


On Thu, Nov 28, 2013 at 2:11 PM, Marcelo Taube <marcelo@xxxxxxxxxxxxxx>wrote:

> Hello,
> I want to write a php script which process a file being upload to the
> server, to check contentes and stores it on the fly, as its being uploaded.
>  My goal is to avoid using the memory needed to hold the whole file, and
> instead just upload it and forgetting the parts already processed.
> I have seen that this "streaming" interface of file uploads exist for HTTP
> PUT method but could not find info on how to do it using  POST.
> So, is there any way of configuring PHP or APACHE to provide uploaded files
> using POST in a streaming fashion?
> If this is not possible, is it because an instrinsic limit of the HTTP
> protocol? a limit on the apache architecture? or a design decision in PHP?
> And last, in PUT method, are I warrantied that the input in stdin comes
> directly to the PHP script or should i expect apache to pre buffer the
> whole file and then just start to send it?
>
> Thank you
>

[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux