使用 HTML 上传 iPhone 文件
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/5784352/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
iPhone File Upload with HTML
提问by Sam Williams
Is there anyway 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.
有没有办法<input type="file">
在 iPhone/iPod Touch 上的 Safari 中使用?或者我可以在浏览器中使用类似的东西吗?我想使用浏览器将照片从设备上传到我的数据库。
采纳答案by Julio Gorgé
Can't be done with plain XHTML/javascript as Safari does not support uploads. See this previous questionfor a potential workaround solution to upload photos.
无法使用普通的 XHTML/javascript 完成,因为 Safari 不支持上传。有关上传照片的潜在变通解决方案,请参阅上一个问题。
回答by tie
This is possible with iOs 6 or greater (http://www.apple.com/ios/whats-new/#safari). The browser renders
iOs 6 或更高版本 ( http://www.apple.com/ios/whats-new/#safari)可以做到这一点。浏览器呈现
<input type="file">
and clicking on "Choose File" prompts the user to take a new photo or choose existing from the photo library.
单击“选择文件”会提示用户拍摄新照片或从照片库中选择现有照片。
回答by Piotr Justyna
I had the same problem today. The alternative browser iCab Mobiledoes support file uploads. I got it for my iPad and (at least for me) file upload works fine.
我今天遇到了同样的问题。替代浏览器iCab Mobile确实支持文件上传。我为 iPad 安装了它,(至少对我而言)文件上传工作正常。