I have the following code that presents the user with a preview of the image they're trying to upload and works really well in FF:
var img = document.createElement('img');
img.src = $('#imageUploader').get(0).files[0].getAsDataURL();
The problem is, getAsDataURL()
only works in FF. Is there something similar/a workaround for this kind of functionality in Chrome (specifically)?
If the browser doesn't support getAsDataURL
you could make sure that the file input is instead using Gears' openFiles (scroll down) to read a file selected by the user.
Google ain't working on Gears anymore, but it will work in Chrome, at least until getAsDataURL()
gets implemented.
EDIT: Changed answer to be more helpful.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With