Upload library error with new Apple file format and HEIF |
Good morning all,
I use the upload library to manage the sending files on my responsive website. I wish send photos from my iPhone but the new Apple file format doesn't seem to work. Do you know how to correct this problem please? $ config ['allowed_types'] = 'gif | jpg | JPG | jpeg | JPEG | png | PNG | heic | HEIC | heif | HEIF'; $ this-> load-> library ('upload', $ config); Thank you. I wanted to add some strange information. Using the following configuration, the HEIC format image is sent correctly from my iPhone while Mime type is not allowed. It doesn't work from a computer even adding HEIC in allowed_types ... $ config ['allowed_types'] = 'gif | jpg | JPG | jpeg | JPEG | png | PNG';
In my answer I assume you are using File Upload Class in CI3.
1. Try to remove all allowed_types at all, to check if file can be uploaded without that limitation. Probably HEIC/HEIF file is too large and goes beyound file upload limits defined in your php.ini 2. Try to add the following 3 extentions to allowed_types: avci, heics to support HEIF files that contain image sequences. So your code should be (all lowercase is sufficient): PHP Code: $config['allowed_types'] = 'gif|jpg|jpeg|png|heic|heif|heics|avci';
You need to check the app\Config\Mimes.php to see if the mime type is in it if not
then you need to add the new mime type to the Mimes.php file. You can get the mime type for HEIF from here. HEIF Related Brands and MIME Types HEIC R Apple High efficiency Image Format HEIC requires the libheif delegate library. What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
Thanks it's ok I add this to the file Mimes.php
Code: 'heic' => 'image/heic',
(02-28-2020, 06:26 AM)nicolas33770 Wrote: Thanks it's ok I add this to the file Mimes.php If you made a pull request to the ci3 repo on github, you could probably help a lot of us ![]()
Codeigniter is simply one of the tools you need to learn to be a successful developer. Always add more tools to your coding arsenal!
I never do that but it will be cool. I don't know how it's work to push modification like this... I make I try but sourcetree give me an error
Code: Pushing to https://github.com/bcit-ci/CodeIgniter.git In addition to what I said, I would like to add that the behavior of the iPhone is specific, because the file sent from the iPhone does not seem to be in HEIC format? Because it works from an iPhone but not from my computer. Maybe a modification on the fly before sending, I don't know.
You'll have to create a branch in github, make the change, then do a pull request. This is a simple enough change you could probably do it all within the Github interface.
If it's your first time you can read this: https://help.github.com/en/github/collab...ll-request Pretty good skill to know ![]()
Codeigniter is simply one of the tools you need to learn to be a successful developer. Always add more tools to your coding arsenal!
I do directly with Github, I think is ok !? https://github.com/bcit-ci/CodeIgniter/pull/5918
Thanks for your help, I really love CodeIgniter ! |
Welcome Guest, Not a member yet? Register Sign In |