DropzoneJs – drag-and-drop file uploads with image previews
dropzonejs.com
dropzonejs.com
Try this:
Use Settimeout on a loop when generating the thumbnails so the browser is more responsive when you upload dozens of large images.
Also the memory usage is way too large. The GC takes a while to kick in on all the canvases. Have you tried reusing the canvases?
Also IE limits the memory you can use in canvas, when i upload multiple files at the same time i get:
build.js, line 1191 character 9 SCRIPT14: Not enough storage is available to complete this operation.
And only 5 thumbnails got generated.
I looked into this and there is not much you can do i think.
It would be great if it could give you a list of failed uploads though, it would make them easier to search and investigate.
Failed upload and duplicate detection notifications in the UI as well as retry are all planned.
You'd essentially be giving world-write access to your bucket, of course. It would be better to issue signed policies with enforced key names and the like.
https://developer.mozilla.org/en-US/docs/Web/API/FileReader
Linked in that article is this:
https://mdn.mozillademos.org/files/3699/crossbrowser_image_p...
That takes care of most IE. I think it goes down to 7. I know it does 8 and 9 for sure.
2. This replaces your file_fields. You'll still need something on the backend to deal with image storage and management, like Paperclip or Carrierwave.
Paperclip and Carrierwave (I highly recommend Carrierwave) manage the actual storage of the file data (ie on S3) and the incorporation of the file into your ActiveRecord model (I'm glossing over a lot but hopefully you get the idea).
Basically, Dropzone would be a companion to your Rails-based file storage mechanism.