A
A
Aecktann2011-01-22 11:14:11
PHP
Aecktann, 2011-01-22 11:14:11

Streaming File Processing in PHP

Hello.

I want to organize the upload of files to the server via HTTP so that the server subsequently uploads these files to the local DC++. Thus, I need to calculate the TTH of the file. In PHP, by default, the script is called only after the request has been completely received, and the uploaded file is already in the directory for temporary files. Thus, it turns out that the file will have to be read again, and the user will have to wait.

Is there a method to calculate the hash of an uploaded file on the fly without waiting for the upload to complete?

Answer the question

In order to leave comments, you need to log in

4 answer(s)
R
Roman Gogolev, 2011-01-23
@romka777

Open a listen socket and receive a file.
Here on the fly, count the performance characteristics

K
k0der, 2011-01-22
@k0der

maybe using the PUT method?
www.php.net/manual/en/features.file-upload.put-method.php

A
Andrey Yantsen, 2011-01-23
@zvirusz

I can offer 2 options - still use perl to receive the file, or look at how the uploadprogress pecl extension works and perform shamanism on this site. I don't know the normal way.

V
Vyacheslav Plisko, 2011-01-22
@AmdY

look in the direction of the extensions that were used for ajax uploading files with a progressbar, now apc is used, but there is something else in pecl, google it.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question