problem med move_uploaded_file
Hej,Jeg er ny i PHP - ved at konvertere fra ASP.
Jeg sidder med et problem med move_uploaded_file.
<?
$uploaddir = "/uploads/";
$uploadfile = $uploaddir. $_FILES['userfile']['name'];
print "<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);
}
print "</pre>";
?>
fejlen ser sådan ud:
Warning: move_uploaded_file(/uploads/SW_hjoerne.gif): failed to open stream: No such file or directory in C:\Apache2\htdocs\phpsite\fileupload.php on line 14
Warning: move_uploaded_file(): Unable to move 'C:\WINDOWS\TEMP\php63.tmp' to '/uploads/SW_hjoerne.gif' in C:\Apache2\htdocs\phpsite\fileupload.php on line 14
Possible file upload attack! Here's some debugging info:
Array
(
[userfile] => Array
(
[name] => SW_hjoerne.gif
[type] => image/gif
[tmp_name] => C:\WINDOWS\TEMP\php63.tmp
[error] => 0
[size] => 239
)
)
Er det et problem med stien, eller er det en skriverettighed eller lign. der ikke er sat.
Jeg vil gerne have flyttet filen til c:apache2/htdocs/phpsite/uploads