Welcome Guest, Not a member yet? Register   Sign In
File Uploading Class doesn't allow xlsx extension.
#1

[eluser]Unknown[/eluser]
When i try to upload a xlsx file i recived the error "The type file is not allowed". Is this a bug?


My code:

Code:
$config['upload_path'] = './assets/uploads/files/seguimiento/';
$config['allowed_types'] = 'xls|xlsx';
$config['max_size'] = '2048';
$config['file_name'] = 'FS_'.$usuario->username;
$this->load->library('upload', $config);
  
  
if ( ! $this->upload->do_upload("documento") )
{
      $datos['mensaje'] = $this->upload->display_errors();

}
#2

[eluser]CroNiX[/eluser]
check and make sure the mime types for those file types are correct in the application/config/mimes.php
#3

[eluser]Unknown[/eluser]
I added application/zip to xlsx and it works.Thank you.

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

I dont know why xlsx file have this mime type.
#4

[eluser]Narf[/eluser]
application/zip is already added to mimes.php in the current development version.




Theme © iAndrew 2016 - Forum software by © MyBB