note 25204 added to features.file-upload
| From: | bazouka56 at hotmail dot com | Date: | Sat, 14 Sep 2002 00:25:34 +0000 |
| Subject: | note 25204 added to features.file-upload | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-36659@lists.php.net to get a copy of this message | ||
I used this script :
<?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>
to uplaod some files but it does'nt work because i cant define this
:/Library/WebServer/yourURL.com/upload
thanks for help
--
http://www.php.net/manual/en/features.file-upload.php
http://master.php.net/manage/user-notes.php?action=edit+25204
http://master.php.net/manage/user-notes.php?action=delete+25204
http://master.php.net/manage/user-notes.php?action=reject+25204