Trying to use php to upload a file to the server.
The page to select the file to upload includes the code:
The insertblog.php page includes the code:
When I Submit the form I get the following warnings and the file is not moved to the server.
Warning: move_uploaded_file(/home/mydomain/public_html/myfilename.htm): failed to open stream: Permission denied in /home/mydomain/public_html/insertblog.php on line 61
Warning: move_uploaded_file(): Unable to move '/var/tmp/phpwB4fBN' to '/home/mydomain/public_html/myfilename.htm' in /home/mydomain/public_html/insertblog.php on line 61
Any suggestions as to what's wrong will be appreciated.
The page to select the file to upload includes the code:
Code:
<form enctype="multipart/form-data" action="insertblog.php" method="post">
<input type="hidden" name="MAX_FILE_SIZE" value="30000">
<input name="userfile" type="file" />
<input type="submit" value=" Submit " />
</form>
The insertblog.php page includes the code:
Code:
if (move_uploaded_file($_FILES['userfile']['tmp_name'], $uploadfile)) {
echo 'The blog has been added to the Web Log Archive';
}
else {
echo 'The upload was unsuccessful';
}
When I Submit the form I get the following warnings and the file is not moved to the server.
Warning: move_uploaded_file(/home/mydomain/public_html/myfilename.htm): failed to open stream: Permission denied in /home/mydomain/public_html/insertblog.php on line 61
Warning: move_uploaded_file(): Unable to move '/var/tmp/phpwB4fBN' to '/home/mydomain/public_html/myfilename.htm' in /home/mydomain/public_html/insertblog.php on line 61
Any suggestions as to what's wrong will be appreciated.