note 105754 rejected from function.move-uploaded-file by danbrown
| From: | danbrown@php.net | Date: | Mon, 12 Sep 2011 17:01:08 +0000 |
| Subject: | note 105754 rejected from function.move-uploaded-file by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-183115@lists.php.net to get a copy of this message | ||
Note Submitter: hussainhakimuddin11 at gmail dot com
----
hi, i am trying to code a file uploader in php using IIS server this is the code of the form:
<html><body>
<form method="post" enctype="multipart/form-data"
action="processform.php">
<input type="hidden" name="MAX_FILE_SIZE" value="200000">
<input type="file" name="thefile"><br/>
<input type="submit" value="Submit File....">
</form>
</body></html>
this is the code of processform.php
<?php
$upload_dir = "C:/Inetpub/wwwroot/cbt/upload/";
$upload_file = $upload_dir . basename($_FILES['thefile']['name']);
if(copy($_FILES['thefile']['tmp_name'],$upload_file)){
echo "File copy was Successful!";
}
else
{
echo "Oops... something went wrong...";
print_r($_FILES);
}
?>
now the problem is each time i try to click on the submit button after browsing any file it shows
the message :
Warning: copy(C:/Inetpub/wwwroot/cbt/upload/1.jpeg) [function.copy]: failed to open stream:
Permission denied in C:\Inetpub\wwwroot\cbt\processform.php on line 8
Oops... something went wrong...Array ( [thefile] => Array ( [name] => 1.jpeg [type] =>
image/jpeg [tmp_name] => C:\temps\php67.tmp [error] => 0 [size] => 59592 ) )
help me guys......
wats the problem with the code ?