php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #18117 Retreive Content-Length of files being posted.
Submitted: 2002-07-02 14:15 UTC Modified: 2002-07-02 21:37 UTC
Votes:3
Avg. Score:5.0 ± 0.0
Reproduced:2 of 2 (100.0%)
Same Version:2 (100.0%)
Same OS:2 (100.0%)
From: phpfeature at panman dot nl dot nospam Assigned:
Status: Not a bug Package: Feature/Change Request
PHP Version: 4.2.1 OS: Any
Private report: No CVE-ID: None
 [2002-07-02 14:15 UTC] phpfeature at panman dot nl dot nospam
What i really would like to see, in some next version, is this: some way to retrieve the (temporary) filenames and, more important, the expected Content-Length (if any is given, offcource), of files being uploaded. This would be verry usefull with file uploads: One could create a (self reloading) popup with the progress of the files beeing uploaded. (the content length could be compared to the file in the temp directory). I think easiest way to pass this variables would be a session, or a temp file that could be parsed in the temp dir, that is beinig deleted with the other uploaded files, if the target script finishes. For now I can show the size of all the files being uploaded, but since i don't know the expected size, there is no way of telling the progress to the user.
I 'masked' my email adress since i got a lot of spam on the email adress i used on this site before.
Thanx in advance! PanMan.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-07-02 14:25 UTC] sniper@php.net
Not possible. The file is already uploaded by the time
the script starts..

 [2002-07-02 14:29 UTC] phpfeature at panman dot nl dot nospam
Yes, i know, it's uploaded when the target script starts. But while it's being uploaded I would like to call another script that shows the progress of the upload. This script should get the Content-Length of the files being uploaded from somewhere. PHP does handle the file before the script starts. I think this only asks for a quite small addition to rfc1867.c in the PHP source. Unfortunataly, i don't know enough about C to do it myself.
 [2002-07-02 21:35 UTC] phpfeature at panman dot nl dot nospam
So, to make clear: this script should being executed while the upload is in progress. (uploading large files can take several minutes).
 [2002-07-02 21:37 UTC] sniper@php.net
Feel free to provide a patch..

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Jun 03 07:01:33 2024 UTC