I get this error everytime i hit the submit button. Everything else is submitted to the database, only the image isn\'t. Warning: file_get_contents(): Filename cannot be empty
In the $_FILES
array, you've said you're getting [name]=>DSC_0770.JPG[type]=> [tmp_name]=>[error]=>1[size]=>0
If tmp_name
is not given, that means the file was not uploaded.
The error you're given is 1
, and according to the upload error messages explained page this means: that the uploaded file exceeds the upload_max_filesize directive in php.ini.
You can do the following to fix this.
upload_max_filesize
.ini_set('upload_max_filesize', '20M');
or whatever size you want at the start of your script.