Hooking up Dropzone.js with ActiveStorage DirectUpload via Stimulus.js

Julian Rubisch
Boiling Plates
Published in
1 min readSep 1, 2018

Recently I was trying to implement a drag‘n‘drop upload solution with Rails ActiveStorage (wired to Amazon S3 internally), but found the docs rather sparse. One other helpful snippet was this.

So when I managed to do it, I decided to write up this (my first) github gist. So here it is:

Careful, this is only the beginning! As we overwrite Dropzone‘s drop event handler, we have to take care of everything (e.g. error handling) ourselves.

--

--