I'm writing a file upload script.

When a file has been uploaded, one can get the temporary file name using:
$_FILES[’file’][’tmp_name’]

However, is there a way to know what the temp file is called before the file is fully uploaded?

For example, if I'm uploading a 70M file, which takes say 5 minutes. Is there a way to know what the temp file is called 2 minutes into the upload?

TIA.

    I do not believe the receiving PHP script actually starts running until the file finishes uploading, so from that viewpoint the question is probably meaningless. If looking at it from some other viewpoint, the upload_tmp_dir setting will tell you the upload directory, should you want to [man]glob/man it or such to see what files are in there.

      Thanks for your answer.

      I'm trying to write an "upload progress meter" for large file uploads.

      The idea is to keep checking the file size of the temporary file every second or so using AJAX.

      Php names files in temp folder with random xters such as 478819b281ebb.

      It would have been nice if I had control over what the temp file is called. That way I can generate it myself in the form, and refer to it as the file is being upload.

      Meanhwile if anybody knows an upload progress meter that does not require perl, APC, flash, etc, please let me know.

      Thx.

        The second link looks promising since I'm on php 5.2. I'll post back my findings. Thank you.

          Write a Reply...