php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #22913 HTTP Upload bug
Submitted: 2003-03-26 19:01 UTC Modified: 2003-04-01 08:31 UTC
From: luke at cywh dot com Assigned:
Status: Not a bug Package: HTTP related
PHP Version: 4.3.2RC1 OS: Windows XP
Private report: No CVE-ID: None
 [2003-03-26 19:01 UTC] luke at cywh dot com
Ok, when im uploading using the http method, the temp files arnt deleting when the upload is complete. also when your uploading multiple files, lets say about 9 files, it skips some of the files.

im running the CVS version that i installed 9 hours ago.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-03-27 17:11 UTC] magnus@php.net
Please provide a short but complete script to reproduce it.
If it is more then 20 lines, please provide an URL to the script.
 [2003-03-27 18:52 UTC] luke at cywh dot com
Ok here is the upload script... (basicly it cycles through the 9 uploaded temp files and copies them....

$udy="fupload$u";
$mtemp=$_FILES[$udy]['tmp_name'];
$mname=$_FILES[$udy]['name'];

if($mname)
{
if(@copy($mtemp,"$login/$mypath".$mname))
{
echo "<font color=\"blue\">".$mname." has been uploaded.</font><br>";
}else{
echo "<font color=\"red\">File didnt finish uploading</font><br>";
}
}
$u=$u+1;
}

here is the forum script for uploading...

<table width="100%" cellspacing="0">
<tr bgcolor="#397DF3">
<td><b>Upload Files</b></td>
</tr>
<tr bgcolor="#FFFFFF"><td><center>

            <input type="file" name="fupload1" id="fupload1">
            <input type="file" name="fupload2" id="fupload2">
			<input type="file" name="fupload3" id="fupload3">
<br>
            <input type="file" name="fupload4" id="fupload4">
            <input type="file" name="fupload5" id="fupload5">
			<input type="file" name="fupload6" id="fupload6">
<br>
            <input type="file" name="fupload7" id="fupload7">
            <input type="file" name="fupload8" id="fupload8">
			<input type="file" name="fupload9" id="fupload9">
			<input type="hidden" name="uploadit" id="uploadit" value="uploader">
          </center></td></tr>
<tr bgcolor="#397DF3">
<td>
<center><input type="submit" value="Upload"></center>
</td>
</tr>
</table>

Problem 1) When the file gets uploaded and copied to the desired location and the script ends, php is supposed to delete the temp file. Its not doing that.

Problem 2) A few of my users (using the file manager), said that they uploaded multiple files and it skiped some of the files, but it said it uploaded them so im asuming there might be a problem with copy. like maybe its not copying the file but returning true. from what i understand it doest happen all the time.
 [2003-03-27 18:54 UTC] luke at cywh dot com
forgot a part of the first. script.... here it is...

$u=1;
while($u!=9)
{
$udy="fupload$u";
$mtemp=$_FILES[$udy]['tmp_name'];
is_uploaded_file($mtemp);
$mname=$_FILES[$udy]['name'];

if($mname)
{
if(@copy($mtemp,"$login/$mypath".$mname))
{
echo "<font color=\"blue\">".$mname." has been uploaded.</font><br>";
}else{
echo "<font color=\"red\">File didnt finish uploading</font><br>";
}
}
$u=$u+1;
}
 [2003-03-27 19:04 UTC] sniper@php.net
Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions. 

Thank you for your interest in PHP.

Using a proper script this works just fine.

 [2003-03-27 20:31 UTC] luke at cywh dot com
yeah but the temp files arnt deleting them selves when the script ends and it should be. it did before.
 [2003-04-01 08:27 UTC] luke at cywh dot com
Its confirmed. It works great as a CGI, but as a module it messes up. When i had it as a module i couldnt get phpinfo() to work, but when i did it as a CGI it worked fine.

something else to, when i had it as a CGI `php_admin_value` didnt work. apache said it was an invalid command.

(i switched it back to module).

im very sure i installed php correctly and completlely. when i install it, i do it manualy with the windows binaries. ive installed php a bunch of times. what i usually do is i delete the entire folder and the files i had to move around, and then reinstall it from the begining. so yes im sure it has all the correct dll's

question: why does the php logo on the phpinfo() have an icon of a dog?. is its because its a "snapshot"? lol.
 [2003-04-01 08:28 UTC] luke at cywh dot com
...
 [2003-04-01 08:31 UTC] luke at cywh dot com
ingnore this... replied to the wrong one.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Apr 20 15:01:29 2024 UTC