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
$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"
I got it working now.
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.
and its working now.
thanks again.