Closed Lovattows closed 6 years ago
Check out the log produced by the class. Probably there is an issue while detecting MIME types. Please read the documentation accordingly.
Log output this: system information
I see... So basically, you are (as per the log) uploading a file with no extension. The class detects the MIME as being application/vnd.ms-office
But, because of the option no_script
, because there is no file extension, the class tries to add the correct extension. In the list of supported MIME types, application/vnd.ms-office
is not present (we have application/vnd.ms-excel
for XLS files), and so it adds the extension .txt.
You can try to deactivate the option no_script
to prevent this behaviour. But in fact, your upload should send the correct file name and file extension (which is not the case in your log).
Alternatively, you can try to replace the MIME type for the extension XLS (so to have 'xls' => 'application/vnd.ms-office'
)
Thank you so much, added the MIME type 'xls' => 'application/vnd.ms-office' and worked as well. PS: i can add multiple xls mime_types? 'xls' => 'application/vnd.ms-excel', 'xls' => 'application/vnd.ms-office',
No, you cannot add several ones, as it is a PHP indexed array. Only the last xls key will be taken into account.
Ok, thank you so much.
Hello everyone, i'm trying to upload some files with .xls extension, and inside my folder they are saving that .xls files with .txt extension. Need advice please.