Reputation: 1882
I was wondering if it's possible to load an image (from a form with an < input type="file" /> or something else like drag-and-drop area) only with AJAX ?
I ask this question because everyone have answered : "No it's definitely impossible due to a security problem. A web browser can't access file system".
So how this website do : Mothereffing Animated Gif ?
Thanks ! :)
Upvotes: 2
Views: 346
Reputation: 623
Mothereffing Animated Gif is using Backbone and this script to convert the image to base64 data url.
Upvotes: 1
Reputation: 9916
I googled "ajax drag and drop file", and the first result is this.
Short answer: yes, it's very much possible. You should consider, though, that drag and dropping doesn't work perfectly on every browser/enviroment, so you should still keep an alternate button just in case.
Upvotes: 1