note 23864 deleted from features.file-upload by philip

From: Date: Sat, 15 Feb 2003 15:42:34 +0000
Subject: note 23864 deleted from features.file-upload by philip
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-44000@lists.php.net to get a copy of this message
after many attempts, i found this script from a previous posting above. worked the first time without a hitch. good luck! <?php // Complete working file upload example, Win2KPro, Apache 1.3x, PHP 4.x // Set this line in php.ini // upload_tmp_dir = /Library/WebServer/yourURL.com/upload_directory/ function handleupload() { if (is_uploaded_file($_FILES['userfile']['tmp_name'])) { $realname = $_FILES['userfile']['name']; print "<b>$realname</b> was uploaded successfuly to the upload directory"; print ""; copy($_FILES['userfile']['tmp_name'], "/Library/WebServer/yourURL.com/upload_directory/".$realname); } else { echo "Possible file upload attack: filename ".$_FILES['userfile']['name']."."; } } ?> <html><body> <?php if ($act == "upload") { handleupload(); } ?> <form ENCTYPE="multipart/form-data" method="POST" action="ultest.php?act=upload"> File:<INPUT TYPE="FILE" NAME="userfile" SIZE="35"> <input type="hidden" name="MAX_FILE_SIZE" value="1000000"> <input type="submit" value="Upload" name="B1"> Please click only <b>once</b> and wait for confirmation </form> <a href=ultest.php>clear form</a> </body></html>

« previous php.notes (#44000) next »