Since iOS 6 it is possible to use the <input type='file'>
to access the photo library. I use this to upload images to a wall, through an UIWebView. Works fine.
The input element is kinda nicely implemented by Apple, with a small auto-generated thumbnail between the button and the filename field.
My only problem around this is that I cannot seem to reset this thumbnail. If it set the .value
of the input to null, the filename clears out ("no file selected", as stated initially) but the thumbnail remains. Same thing if I try to .reset()
the html form encapsulating the input. The small image won't go away!
Anyone know how to achieve this?
I am able to have reset work on the containing form. I just did a simple test on my device using webkit inspector attached to it.
I used the simple html above, then the following javascript in the inspector:
Using that removed the thumbnail image for me. I've included an example with inline code here: http://www.mixicon.com/downloads/input.html