How to upload files in a UIWebView on an iPad?

后端 未结 1 2011
伪装坚强ぢ
伪装坚强ぢ 2021-01-19 06:00

Im developing an iPad app, and one of the components of my app has a UIWebView with a web page that has a browse button to upload a file (in this case, photos).

I am

相关标签:
1条回答
  • 2021-01-19 06:56

    There is no way to upload files within a web view on iOS5 and earlier (this might be supported in iOS6, but I couldn't possibly comment on unreleased beta functionality ;-).

    The apps you have seen that do this are almost certainly implementing the functionality using a native image picker control, not an HTML file upload field.

    If you have seen the functionality working from within a web view, what they may have done is used the webview delegate to communicate back from the web view to the native code and triggered a native image picker. The image data can then be passed back to the web view as a base64 encoded data URL using JavaScript.

    0 讨论(0)
提交回复
热议问题