Welcome Guest, Not a member yet? Register   Sign In
An allowed_types and Upload issue
#1

[eluser]Riente[/eluser]
Hello everyone, I have a problem.

I indicate two allowed file types $config[‘allowed_types’] = ‘gif|jpg’;
The point is only the first one works fine. I mean that I can upload gif-files successfully, and when trying to upload a jpg-file I get an error “The filetype you are attempting to upload is not allowed”.
If I write $config[‘allowed_types’] = ‘jpg|gif’; (i.e. swap their positions) then I upload jpg-files just fine, but have problems uploading gif-files.

Here’s my code:
Code:
$this->load->library('upload');
$config['upload_path'] = './img/logos/brands/';
$config['allowed_types'] = 'gif|jpg';
$config['max_size'] = '8192';
$config['encrypt_name'] = TRUE;
$config['max_width']  = '0';
$config['max_height']  = '0';
$this->upload->initialize($config);

if (!$this->upload->do_upload("file"))
{
$img = $data['item']['img'];
}
else
{
// ...
}

What can be the problem?


Messages In This Thread
An allowed_types and Upload issue - by El Forum - 05-08-2012, 11:48 PM
An allowed_types and Upload issue - by El Forum - 05-09-2012, 03:35 AM
An allowed_types and Upload issue - by El Forum - 05-09-2012, 03:42 AM
An allowed_types and Upload issue - by El Forum - 05-09-2012, 10:46 PM
An allowed_types and Upload issue - by El Forum - 05-10-2012, 02:48 AM
An allowed_types and Upload issue - by El Forum - 05-10-2012, 08:40 AM
An allowed_types and Upload issue - by El Forum - 05-10-2012, 08:55 AM



Theme © iAndrew 2016 - Forum software by © MyBB