Hi guys
I’m getting this strange issue when uploading files that are too large.
I have a limit of 5mb for uploads, but when someone tries to upload a larger file, the the following exception is thrown:
finfo_file(): Empty filename or path
This only happens on the production server (lamp stack) but I get the nice flash message in my development environment (MAMP).
I have the following rule in the Document model:
array('document_name', 'file', 'allowEmpty' => false,
'maxSize' => 1024 * 1024 * 5,
'mimeTypes' => 'image/jpg, image/jpeg, image/pjpeg, image/png, application/pdf,
application/msword, application/vnd.openxmlformats-officedocument.wordprocessingml.document, text/plain',
'tooLarge' => 'The file was larger than 5MB. Please upload a smaller file.',
'wrongType' => 'You can only upload files of the type listed on this page.',
'message' => 'Please select a file to upload.')
and I’m saving the file as follows:
if ($model->validate() && $model->save() {
....
I don’t understand why it would work fine in MAMP but not on the server.
Any ideas would be greatly appreciated!