Elliot Levin
Elliot Levin

Reputation: 460

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?

Upvotes: 13

Views: 3467

Answers (1)

Segev
Segev

Reputation: 19303

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.

Upvotes: 8

Related Questions