<title>PHP Upload Files</title> PHP Upload Files
sudo vi/etc/php.ini
File_uploads = Onupload_max_filesize = 100m # The maximum allowable upload file size post_max_size = 100M # refers to the maximum value that can be received by the form POST to PHP Max_exe Cution_time = # maximum time value per PHP page run (seconds) memory_limit = 128M # maximum memory eaten per PHP page
$name=$_files["MyFile"]["Name"];$type=$_files["MyFile"]["Type"];$size=$_files["MyFile"]["Size"];$Temp=$_files["MyFile"]["Tmp_name"];$Error=$_files["MyFile"]["Error"];if($Error> 0) { die("Error uploading file! Code$error.");}Else{if(Is_uploaded_file ($Temp)) {if(Move_uploaded_file ($Temp,"uploaded/".$name) ) {Echo "Upload complete!"; }Else{Print_r (Error_get_last ()); } }Else{Echo "Upload_file error \ n"; }}
Permissions issues:
chmod O+w uploaded
After confirming that it is not the error, then it should be the SeLinux problem
sudo setenforce 0
Uploading the file should be successful.
PHP Upload Files