简体   繁体   中英

iOS 6 “HTML Input file tag” doesn't work if load the web page in UIWebView

We know that in iOS 6 mobile safari supports HTML input file tag to upload images. I just created an HTML file like this and it worked fine in mobile safari. But when I loaded it in a UIWebView, I found I could still tap the "Choose file" button to choose an image file, but after I tapped "done" and returned to the UIWebView, the web page in the UIWebView reloaded and no file was attached to the HTML form. Is that a restriction to UIWebView?

I have sorted it out. This is due to I put the UIWebview loading web page function in "-viewWillAppear:(BOOL)animated". So each time when the "take photo" modal view hides, the UIWebview reloads the url. I have fixed it and I can confirm now that the HTML input file tag upload function works well in UIWebview, too.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM