Prøv:
<?
if (isset($_FILES["userfile"])) {
$uploaddir = '/var/www/uploads/';
$uploadfile = $uploaddir . $_FILES['userfile']['name'];
echo "<PRE>";
if (move_uploaded_file($_FILES['userfile']['tmp_name'], $uploadfile)) {
print "File is valid, and was successfully uploaded. ";
print "Here's some more debugging info:\\n";
print_r($_FILES);
} else {
print "Possible file upload attack! Here's some debugging info:\\n";
print_r($_FILES);
}
echo "<"."/pre>";
}
else {
?>
<form enctype="multipart/form-data" action="<?=$PHP_SELF?>" method="post">
<input type="hidden" name="MAX_FILE_SIZE" value="30000" />
Send this file: <input name="userfile" type="file" />
<input type="submit" value="Send File" />
</form>
<?
}
?>
Husk nu at ændre $uploaddir
/AC
[Redigeret d. 24/01-04 12:23:35 af AC]