Re: Processing the file as its being uploaded
| From: | Marcelo Taube | Date: | Thu, 28 Nov 2013 19:52:32 +0000 |
| Subject: | Re: Processing the file as its being uploaded | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-322530@lists.php.net to get a copy of this message | ||
Thanks jose
I prefer not to have temporary files nor files in memory.
I wonder if the PUT method achieves my desired results though.
On Thu, Nov 28, 2013 at 9:19 PM, Jose Nobile <jose.nobile@gmail.com> wrote:
> 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@nivelmedia.com>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
>>
>
>
--
Marcelo Taube
E: marcelo@nivelmedia.com
P: +972504515609
S: www.nivelmedia.com