hi
my code in test.php is
<form enctype="multipart/form-data" action="uploader.php" method="POST">
<input type="hidden" name="MAX_FILE_SIZE" value="100000" />
Choose a file to upload: <input name="uploadedfile" type="file" /><br />
<input type="submit" value="Upload File" />
</form>
and code in uploader.php is
<?php
// turn on all run-time errors:
ini_set('display_errors', 1);
error_reporting(E_ALL);
$target_path = "D:/inetpub/ermatas.com/www/uploads/";
$target_path = $target_path . basename( $_FILES['uploadedfile']['name']);
if(move_uploaded_file($FILES['uploadedfile']['tmp_name'], $target_path)) {
echo "The file ". basename( $FILES['uploadedfile']['name']).
" has been uploaded";
} else{
echo "There was an error uploading the file, please try again!";
echo "<pre>".print_r($_FILES,1)."</pre>\n";
}
?>
and error coming is
Warning: move_uploaded_file(D:/inetpub/ermatas.com/www/uploads/10x10.gif) [function.move-uploaded-file]: failed to open stream: Permission denied in D:\inetpub\ermatas.com\www\uploader.php on line 10
Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to move 'C:\php\upload\php9D2.tmp' to 'D:/inetpub/ermatas.com/www/uploads/10x10.gif' in D:\inetpub\ermatas.com\www\uploader.php on line 10
There was an error uploading the file, please try again!
Array
(
[uploadedfile] => Array
(
[name] => 10x10.gif
[type] => image/gif
[tmp_name] => C:\php\upload\php9D2.tmp
[error] => 0
[size] => 49
)
)
i all ready checked permission is 0777. but still getting error dont know why..!