Hooked up dropzone + s3 direct file uploads and now I'm going to keep all that knowledge to myself mwhahahaha- A Ryan 27 August 2017 Fortunately, I knew about imgix.Ī lot of the other writings on the internet don’t really cover it from start-to-finish, and so I pieced all this together from many, many blog posts and documentation pages. Googling for other people’s attempts to solve or workaround this problem suggest that the best solution was to upload to s3 directly but then I would lose the automatic resizing for images that comes with Paperclip. So I had to come up with an inventive solution. It’s at this point that I should mention three things: 1) this application is hosted on Heroku 2) Heroku’s request timeout is set to a hard 30 seconds 3) Australian internet is prohibitively slow and iPhone videos are so big that any video longer than 25 seconds does not upload within that 30 second window. Dropzone lets me do that.īut then I wanted to add video support to this application. A simple file input would also work, but I wanted to be able to upload multiple files from all kinds of devices. I got the attachments through to Paperclip by using the wonderful Dropzone.js. Paperclip works very well, and I especially love that I don’t have to care about how my photos get resized Paperclip just does it – as long as you have the right things installed. This app had humble beginnings: it was a very light Rails application with one model that used Paperclip to handle the attachments. I’ve got a small hobby Rails app that I use to share photos with my extended family. The Rails app that I use for this tutorial is dropzone-example, with the finished branch being the final version of the code from this tutorial. I’ll then show how you can use imgix to resize these images dynamically after they’ve been uploaded. In this tutorial I’ll cover how you can upload files directly to S3 by using a feature called PresignedPost. Ryan Bigg ⟵ Posts Rails, Dropzone.js, Amazon S3 and imgix
0 Comments
Leave a Reply. |