Is there any way to use <input type="file"> in Safari on iPhone/iPod Touch? Or is there something similar that I can use inside the browser? I want to upload a photo from the device to my database using the browser.
Asked
Active
Viewed 4.9k times
16
TRiG
- 9,687
- 6
- 54
- 105
Sam Williams
- 723
- 1
- 6
- 13
-
possible duplicate of http://stackoverflow.com/questions/3891831/a-html5-web-app-for-mobile-safari-to-upload-images-from-the-photos-app – PiTheNumber May 16 '12 at 09:15
-
Yes there is, see [this answer](http://stackoverflow.com/a/40529202/813988). – Octavian Naicu Nov 10 '16 at 13:59
3 Answers
19
This is possible with iOs 6 or greater (http://www.apple.com/ios/whats-new/#safari). The browser renders
<input type="file">
and clicking on "Choose File" prompts the user to take a new photo or choose existing from the photo library.
tie
- 543
- 6
- 13
-
8This method is very buggy, as you should use `` instead. See [Andy's post](http://stackoverflow.com/questions/5784352/iphone-file-upload-with-html#answer-19576153). – Slavik Meltser Feb 27 '14 at 16:08
-
-
Audio is part of the spec (http://w3.org/html/wg/drafts/html/CR/forms.html#attr-input-accept) but it is up to the browser to support it or not and currently safari for ios does not. Found this table for browser support (a bit old) http://books.google.com.au/books?id=gswdarRZVUoC&lpg=PA263&dq=file%20upload%20compatibility%20table&pg=PA263#v=onepage&q=file%20upload%20compatibility%20table&f=false – tie Apr 26 '14 at 06:53
-
6
Can't be done with plain XHTML/javascript as Safari does not support uploads. See this previous question for a potential workaround solution to upload photos.
Community
- 1
- 1
Julio Gorgé
- 10,018
- 2
- 44
- 60
-
1Honourable mention to http://picupapp.com which performs a similar function to the Google code, and is already deployed to the app store. – Ben Feb 12 '12 at 15:01
-
2
-
Safari on iOS6.0+ supports image/video upload & capture through ``, see [this answer](http://stackoverflow.com/a/40529202/813988) – Octavian Naicu Nov 10 '16 at 14:03
0
I had the same problem today. The alternative browser iCab Mobile does support file uploads. I got it for my iPad and (at least for me) file upload works fine.
TRiG
- 9,687
- 6
- 54
- 105
Piotr Justyna
- 4,622
- 3
- 23
- 40