How to upload files to UIWebView on iPad?

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

I know that applications cannot access the file system, but I have seen applications in the App Store that achieve this functionality with photos. Many of them are written for the iPhone.

I do not want to use a third-party application to get this function, I want to embed this functionality in my application.

I have already done an end-to-end search and cannot find information about this development.

Anyone have any suggestions?

+4
source share
1 answer

It is not possible to upload files to a web view on iOS5 and earlier (this may be supported on iOS6, but I could not comment on unreleased beta features;).

The applications that you saw that do this almost certainly implement the functionality using your own image selection control, rather than a field for loading HTML files.

If you saw functionality working from a web view, then what they might have done is used by the web view delegate to link to the web view with its own code and runs its own image collector. The image data can then be transferred back to the web view as the URL of the base64 encoded data using JavaScript.

+1
source

All Articles