Error 7 is,
UPLOAD_ERR_CANT_WRITE
Value: 7; Failed to write file to disk. Introduced in PHP 5.1.0.
I have PHP 5.3 on server.
Code :
- <?php
-
-
if($_FILES["f1"]){
-
-
echo ini_get("upload_tmp_dir")."<br />";
-
print_r($_FILES);
-
exit();
-
-
}
-
-
?>
-
<br /><br />
-
<form enctype="multipart/form-data" method="post" action="index.php">
-
<input type="file" name="f1" /><br />
-
<input type="submit" />
-
</form>
When I try to upload any file, it prints this :
/var/www/html
Array ( [f1] => Array ( [name] => New Text Document.txt [type] => [tmp_name] => [error] => 7 [size] => 0 ) )
I printed "upload_tmp_dir" value to see if the script is picking it up from php.ini
This contstant was set blank by default. I have set 777 permissions on /var/www/html
I have checked other required parameters too in php.ini like post_max_size, timeout etc.
Thanks,
Sandeep