Error using HTML/PHP file upload

Status
Not open for further replies.

ngelection

New Member
Messages
2
Reaction score
0
Points
0
I get the following error when using my PHP upload form:

The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, webmaster@ngelect.x10hosting.com and inform them of the time the error occurred, and anything you might have done that may have caused the error.
More information about this error may be available in the server error log.
Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.



My PHP code is as follows:



$uploaddir = '/home/ngelect/public_html/images/';
$uploadfile = $uploaddir . basename($_FILES['userfile']['name']);

if (move_uploaded_file($_FILES['userfile']['tmp_name'], $uploadfile)) {
echo "File is valid, and was successfully uploaded.\n";
} else {
echo "Possible file upload attack!\n";
}
 

Christopher

Retired
Messages
14,659
Reaction score
8
Points
0
Make sure the permissions of the folder you are uploading to are 755.
 
Last edited:
Status
Not open for further replies.
Top