|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #58929 Location of the HIDDEN vars prevents uploads
Submitted: 2009-10-29 17:52 UTC Modified: 2009-10-30 02:46 UTC
From: shawn dot britton at yahoo dot com Assigned:
Status: Wont fix Package: uploadprogress (PECL)
PHP Version: 5.0.2 OS: Unix
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2009-10-29 17:52 UTC] shawn dot britton at yahoo dot com
I have the script hosted at on their cloud sites service which has this library installed.  I have noticed that the order of the hidden variables in relation to the file field determines if the upload is successful or not.  If the "UPLOAD_IDENTIFIER" and "MAX_FILE_SIZE" is before the file info, the progress bar works fine, but the upload does not work (TMP directory never gets the file).  However, if I put the hidden vars after the file field, the upload works perfectly, but the progress bar does not work.

Reproduce code:
if ($_POST['submitted'] == '1') {
	echo "<pre>";
	echo "</pre>";	
<form action="delme.php" method="post" enctype="multipart/form-data" >
	<input type="file" name="upload_file" id="upload_file" size="55" />
	<input type="hidden" name="submitted" id="submitted" value="1" /><br />
	<input type="submit" name="continue" id="continue" value="Upload" />
	<!-- if the following lines are at the top of the form, the upload does not work -->
	<input type="hidden" name="MAX_FILE_SIZE" value="4096000000" />
	<input type="hidden" name="UPLOAD_IDENTIFIER" value="<?php echo md5(time());?>" />

Expected result:
I would expect the upload to work and the progress be reported back.

Actual result:
The above code will upload the file, but the progress is not reported back.  If the hidden vars are moved to the top of the form, the progress works, but the uploaded file is nowhere to be found.

Review of the $_FILES shows that there was no temp file created.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2009-10-30 02:46 UTC]
Yes. The location of the HIDDEN var does matter. For 
technical reasons, we can't change that.

See also
for soe of the most common problems

Why it doesn't work at all even if the order is correct, I 
don't know. Did you try with the demo files from 
and see what they report?

You say, that you're using PHP 5.0.2. It's not gonna fly 
with that one, you need at least 5.2
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Sat Oct 31 11:01:24 2020 UTC