Not able to upload

kashiqirphan88

New Member
Messages
4
Reaction score
0
Points
0
I tried to upload a file via a php code but I get this error

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator, no-reply@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.

The code I used was
<?php
if ($_FILES["file"]["error"] > 0)
{
echo "Error: " . $_FILES["file"]["error"] . "<br />";
}
else
{
echo "Upload: " . $_FILES["file"]["name"] . "<br />";
echo "Type: " . $_FILES["file"]["type"] . "<br />";
echo "Size: " . ($_FILES["file"]["size"] / 1024) . " Kb<br />";
echo "Stored in: " . $_FILES["file"]["tmp_name"];
}
?>
 

descalzo

Grim Squeaker
Community Support
Messages
9,373
Reaction score
326
Points
83
Make sure the permissions on the script are 0644
 

kashiqirphan88

New Member
Messages
4
Reaction score
0
Points
0
Thank you guys now am able to upload a file but still am not able to find where the uploaded files get stored
 

lemon-tree

x10 Minion
Community Support
Messages
1,420
Reaction score
46
Points
48
The files will be stored in the directory and file name that $_FILES["file"]["tmp_name"] specifies; this is a temporary directory, meaning the files will not be retained once the script has terminated. To have the files in a certain folder, you need to copy the file yourself within the script.
 
Top