-2

after all the configuration if I am trying to import csv or xls file I am easily being able to do that but, the moment I am trying to import xlsx file gettig an error 'The filetype you are attempting to upload is not allowed'. In the file mimes.php

'xlsx'  =>  array('application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', 'application/zip'),

getting error as 'The filetype you are attempting to upload is not allowed'. Any suggestion will be appreciated thnx.

Tapash
  • 27
  • 3
  • 10
  • visit here [unable-to-upload-an-excel-file-in-codeigniter](https://stackoverflow.com/questions/33427906/unable-to-upload-an-excel-file-in-codeigniter) – Anup Sep 23 '17 at 08:24
  • 1
    Possible duplicate of [unable to upload an excel file in codeigniter](https://stackoverflow.com/questions/33427906/unable-to-upload-an-excel-file-in-codeigniter) – Aziz Saleh Aug 24 '18 at 12:38

2 Answers2

-1

Please try with following

On upload function use

$config['allowed_types'] = '*'; //All Files

If it is working then Please check with $_FILES for what mime type your browser read for .xlsx file

Your can also check with another excel import (If all above solution is not working) http://phpexcel.codeplex.com/

-2

I think you also need to convert your file xlsx to xls or maybe you can save as it xls, and it will work sure.

its working for me after save as xls. OR change your 'xls' parameter in config >> mimes.php file with below.

'xls'   =>  array('application/vnd.ms-excel', 'application/msexcel', 'application/x-msexcel', 'application/x-ms-excel', 'application/x-excel', 'application/x-dos_ms_excel', 'application/xls', 'application/x-xls', 'application/excel', 'application/download', 'application/vnd.ms-office', 'application/msword'),
Vishal P Gothi
  • 987
  • 5
  • 15