Why php give to me error of file upload?
<?php
if($_FILES["filename"]["size"] > 1024*25*1024)
{
$message = 'file must be less, than 25 mb';
exit;
}
if(is_uploaded_file($_FILES["filename"]["tmp_name"]))
{
move_uploaded_file($_FILES["filename"]["tmp_name"], "share/".$_FILES["filename"]["name"]);
$message = 'succesfull!';
} else {
$message = 'Error upload file';
}
?>
form with enctype = 'multipart/form-data'
in php.ini i have got
upload_max_file_size: 25 mb Max_post_data = 25mb upload_tmp_dir = /tmp
Why it does not work?
var_dump($_FILES);instead of pointlessError upload fileand seeis_uploaded_file()fails, then PHP doesn't know why the upload failed. It just knows that it did. The only thing I can think of to check is that there is enough space on/tmp.