uploading fonts in fuel cms assets

hi,
I'm trying to upload font files.

first problem I encountered the browser responded. 'You cannot upload .otf file'.

I tried fixing it by adding the mime type for the otf in config mimes.php file then added also in my_fuel.php the following:
in mimes.php :

'otf' => array('application/font-sfnt', 'application/x-font-opentype', 'font/opentype' ),

in my_fuel.php :
$config['editable_asset_filetypes'] = array(
'fonts' => 'otf',
'assets' => 'jpg|jpeg|jpe|png|gif|mov|mpeg|mp3|wav|aiff|pdf|css|zip|otf',
);

now, it fixes the 'You cannot upload .otf file'.
but I have a new problem when trying to upload the file saying : 'The filetype you are attempting to upload is not allowed.'

what should I do?
need help sir.

thanks.

Comments

  • edited November 2015
    You probably need to check your Apache & PHP configs and enable .otf there too.
  • edited 12:09PM
    That error can be thrown from 3 places so I'd first try and isolate where. The first is from the Fuel_assets::upload() method around line 165:
    $this->_add_error(lang('upload_invalid_filetype'));
    The other 2 places are in the fuel/codeigniter/libraries/Upload.php CI File Uploader class Upload::do_upload method on lines 210 and 233. I'd do a search for the string key of "upload_invalid_filetype"
  • edited 12:09PM
    thanks to both of you.

    I got it working now. :)
  • edited 12:09PM
    I finally got it working. thanks to both of you.

    first, I tried what almostcompletely said about Apache and PHP but it's already enabled by default.

    so next, I tried what the admin said.
    In line 210-233 I var_dump() the $this->file_types. And its printing application/octet-stream

    so, I just added the application/octet-stream to the mime. :D

    and its working now.

    thanks again. :)
Sign In or Register to comment.