• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Upload class - allowed filetype issue

Hi all,

I made a simple upload form for upload rtf files to a congress website:
// Set upload config
$config['upload_path'] = '/www/_shares/_mycongress/abstracts/';
$config['allowed_types'] = 'rtf';
$config['max_size'] = '10000';
$this->load->library('upload', $config);

// Check the upload
    $data['upload_data'] = $this->upload->data();
    $data['upload_data'] = $this->upload->data();
    $data['error'] = $this->upload->display_errors();


But uploading doesn't work, I get the following error out of the var_export($data):
The filetype you are attempting to upload is not allowed

When I change allowed filetypes like this:
$config['allowed_types'] =  '*';

the upload works... (So path and permissions of upload directory are correct)

What goes wrong?

Thanks in advance for the help!


BTW, some further debugging reveals that the RTF uploaded file has a 'file_type' => 'application/msword',
but when I look in config > mimes file, I see 'rtf' => 'text/rtf' as existing mime...
The $mime var in line 620 return no array but FALSE...

Found the solution! Problems with mime type detection have been fixed: I downloaded the most recent Upload library from Github (https://github.com/EllisLab/CodeIgniter/...Upload.php) and the problem was solved!

I love this Framework!

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2019 MyBB Group.