ember-cli-form-data icon indicating copy to clipboard operation
ember-cli-form-data copied to clipboard

How to update thumbnail preview

Open kgish opened this issue 10 years ago • 2 comments

I'm really happy with using ember-cli-form-data thanks!

Maybe this doesn't have much to do directly with this addon, but I was wondering if there was a standard way in my form of updating a preview thumbnail image when a new file is selected in the input file type.

kgish avatar Nov 18 '15 21:11 kgish

Thanks!

I use FileReader API (readAsDataURL) and html canvas#drawImage, but that probably doesn't support some older browsers.

funtusov avatar Nov 19 '15 00:11 funtusov

Yes I am familiar with that, thanks.

My problem is how to observe when a file is selected and then how to access the pathname.

I tried Ember.$(‘#file-id') but the array element file[0] is undefined until an actual file is selected.

kgish avatar Nov 19 '15 06:11 kgish