Forum Moderators: coopster
First I tried uploading a small picture to the same directory where the files were stored...
I tried to set the folder's permissions to 777...however the php file in the directory would not run while the folder was writable. I'm guessing that is a server-side security feature although I'm not sure why that would be forbidden.
So second I moved the php files out of the directory and tried to get the files to upload to a writable directory.
I did some tests to see where it gets hung up. and when the processing php file runs it does not pick up the $_FILES variable at all...
I used print_r($_FILES); and the array was empty.
I checked the php.ini and the variables I expected to be set seemed okay...
Directive // Local Value // Master Value
file_uploads // On // On
upload_max_filesize // 2M // 2M
upload_tmp_dir // no value // no value
Any ideas?
otherwise please put your HTML page(for browsing to the file) and your php page for processing.
PS how did you chmod? make sure it did work as you think. manytimes, wether using cpanel, filezilla, etc... the chmod error is not easily seen and did not take place.
HTML FILE:
<FORM ACTION="upload.php" METHOD="POST">
Upload this file:
<INPUT NAME="file_up" TYPE="file">
<INPUT TYPE="submit" VALUE="Send File">
</FORM>
PHP FILE:
echo $_FILES['file_up']['name'];
$file_name=$_FILES['file_up']['name'];
$add=$file_name; // the path with the file name where the file will be stored, upload is the directory name.
if(move_uploaded_file ($_FILES['file_up']['tmp_name'], $add)){
// do your coding here to give a thanks message or any other thing.
}else{
echo "Failed to upload file Contact Site admin to fix the problem";
}
echo("-".$_FILES['file_up']['size']."-<BR><BR><BR>");
print_r($_FILES);