what's wrong uploading a file
Posted: Sat Mar 13, 2004 4:35 am
whats wrong i upload a file and if i check the dir there's no file
code html
my php code
EDIT: code was from php manual
code html
Code: Select all
<form enctype="multipart/form-data" action="/upload/add.php" method="post">
<input type="hidden" name="MAX_FILE_SIZE" value="99999999999">
Upload dit bestand: <input name="userfile" type="file">
<input type="submit" value="Upload!">
</form>Code: Select all
<?php
/*
test file for uploading files
(C)opyright stefan feenstra
*/
// Voor PHP 4.1.0 moet $HTTP_POST_FILES gebruikt worden in plaats van $_FILES.
if (is_uploaded_file($_FILESї'userfile']ї'tmp_name'])) {
copy($_FILESї'userfile']ї'tmp_name'], "c:/website/upload/files/");
} else {
echo "Mogelijke aanval gespot: " . $_FILESї'userfile']ї'name'];
}
/* ...of... */
move_uploaded_file($_FILESї'userfile']ї'tmp_name'], "c:/website/upload/files");
?>