Invalid file types (upload xls/xlsx) |
Sorry for my bad english, because I speak on other language.
![]() I have a next problem: 1. On two computers installed the same server (denwer) with same versions. 2. I copied all folder with my project and his base from one computer to another. 3. My code contains validation of mime types of uploading files (I use upload library + form validation). PHP Code: $config['allowed_types'] = 'txt|csv|xlsx|xls'; And it works excellent ![]() ![]() ![]() In mimes.php there are .xlsx and .xls by default PHP Code: 'xlsx' => array('application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', 'application/zip', 'application/vnd.ms-excel', 'application/msword', 'application/x-zip'), I tried upload any xlsx/xls files in other scripts, that don't use Codeigniter, and there files upload success. So I think that webserver is not guilty. I don't understand what should I do? Please Help!!!! ![]()
As a first step, in your editor find the line which prints the error message
Above this line insert the following PHP Code: var_dump($_FILES[]); This will tell you what file type CI is recognising... Also, do both machines have the same CI config?
Receiving invalid xls format in your excel workbook but unable to fix this error? Well you can fix this by trying manual as well as automatic solution. For manual solution you must try these steps:
Firstly you need to change the File Extension of Your Excel Sheet. Sometimes, the problem is occurred due to the unsupported file extension of your excel file. To check the support of xlsx extension, go to the ‘My Computer’. Browse ‘Tools >> Folder Options >> File Types’. Make sure that the ‘xlsx’ extension is included there or not. If not then rename this file and change ‘.xlsx’ to ‘.xls’. Use Open and Repair option of excel: For this, just open the Excel workbook and then go to ‘File >> Open option. Choose the file which you want to open but don’t make double tap on it. After then go to the ‘Open’ dialog box and then select ‘Open and Repair’ option from there. This process will fix the corrupt excel spread sheet and open it normally. The chances are very less for the perfect conversion, but yes your damaged file could be recovered of course for sure. |
Welcome Guest, Not a member yet? Register Sign In |