|
Hello.
I have created file upload progress bar. It coded with php and AJAX.
The problem is it works on some servers but doesn't work on another.
Maybe it depends from php or apache version. But maybe from
configuration of php or apache.
I will describe how it works.
When you selects file on the form and click upload, uploading starts
in the iframe. In the same time special AJAX function starts the timer
(1 second interval). Timer callback function starts AJAX request to
another php script that scans /tmp directory and finds newest file
with mask /tmp/php* (temporary uploaded files). Then this script check
file size (it changes while file is being uploaded) and return to
browser. So it is possible to check how many bites are uploaded.
But as i said this method works only on some servers. I tried to check
why the script doesn't work on another servers and noticed that
temporary file (usually named like phpA4Wds ) are created only after
all uploading completed. It means apache gets all posted data
(including file) and only then create file. On other servers file is
created just when uploading started and is increased while uploading.
So my answer is how to make apache write file part by part not all in
the end? |