note 19003 deleted from features.file-upload by victor

From: Date: Sat, 24 Aug 2002 15:28:03 +0000
Subject: note 19003 deleted from features.file-upload by victor
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-35503@lists.php.net to get a copy of this message
<?php // Complete working file upload example, Win2KPro, Apache 1.3x, PHP 4.x // Set this line in php.ini // upload_tmp_dir = c:\inetpub\wwwroot\uploads function handleupload() { if (is_uploaded_file($_FILES['userfile']['tmp_name'])) { $filename = $_FILES['userfile']['tmp_name']; print "$filename was uploaded successfuly<br>"; $realname = $_FILES['userfile']['name']; print "realname is $realname<br>"; print "copying file to uploads dir"; copy($_FILES['userfile']['tmp_name'], "c:\\inetpub\\wwwroot\\uploads\\".$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"><br> <input type="hidden" name="MAX_FILE_SIZE" value="1000000"> <input type="submit" value="Upload" name="B1"><br><br> Please click only <b>once</b> and wait for confirmation </form> <br><br> <a href=ultest.php>clear form</a> </body></html>

« previous php.notes (#35503) next »