Assets upload (feature/1.4_dev)

edited February 2016 in Bug Reports
Asset uploads fail with "The filetype you are attempting to upload is not allowed."

I've traced the issue to /codeigniter/librares/upload.php line 900

if (isset($this->_mimes[$ext]))
{
return is_array($this->_mimes[$ext])
? in_array($this->file_type, $this->_mimes[$ext], TRUE)
: ($this->_mimes[$ext] === $this->file_type);
}

this always fails and the function returns false

There are no mimes defined in the class, I'm not sure if they need defining in the class or whether codeigniter should pick them up form fuelCMS.

Comments

  • edited 10:29PM
    What file type are you trying to upload and what type is it actually checking in the Upload class? You may need to modify your fuel/application/config/mimes.php file. Sometimes the server will return a different mime-type then what is expected (e.g. I've seen a zip file type for PDF files, etc).
  • edited 10:29PM
    Sorry Dave, that might be useful information.

    I'm trying to upload a small .jpg.

    It's getting the right file type in the upload class, the detail of the upload file are correct:

    array (
    0 => 750,
    1 => 500,
    2 => 2,
    3 => 'width="750" height="500"',
    'bits' => 8,
    'channels' => 3,
    'mime' => 'image/jpeg',
    )

    the mime.php in application/config look good.

    Cheers
  • edited 10:29PM
    I think the issue had to do with the 1.4_dev branch having an older version of the mimes in the config. It should be returning the array instead of specifying a $mimes array. I've updated that config to reflect that:
    https://github.com/daylightstudio/FUEL-CMS/commit/2bdee1120d2f9fa4ac00df002839ca8a34d41b0c
  • edited 10:29PM
    Cheers
Sign In or Register to comment.