Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to make a file input upload the original image file instead of forcing conversion to jpeg on IOS

When attempting to upload an image file stored on an iPhone running IOS 7 on the Safari browser, regardless of the original image format, the selected image files are always converted to a JPEG.

<input type="file" accept="image/*">

I have attempted to be more specific with the accept attribute such as image/png with this fiddle but have not had any luck.

Are there any known solutions, hacks or workarounds to preserve the original image file when uploading?

like image 356
Elliot Levin Avatar asked Dec 28 '14 01:12

Elliot Levin


1 Answers

You can't. Mobile Safari for iOS is very limited when it comes to uploading. Your image will always be converted to JPEG with lower quality than the original image.

"Solutions" :

The obvious one is to go native (which probably beats the purpose of this question but I thought I'll throw it in anyway.)

The more "reasonable" solution is to ask the user to give you a link to the original picture (dropbox for example) or something of that sort. Still, not really a solution but like I said, currently there aren't any good solutions for this problem.

like image 152
Segev Avatar answered Oct 20 '22 10:10

Segev