|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[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. PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 00:00:02 2025 UTC |
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.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; }