How can you send a file to S3 after processing is completed using paperclip in rails?

I have a rails app with video and image models. Both use SWFUpload for feedback, indicating progress and loading to the queue. Thus, they are loaded into TempImage and TempVideo, and then, when ActiveRecord video and image models are saved, the pace moves.

In styles, different styles are created using the default paperclip processor. In the videos, after they are downloaded, they are queued in the background (using the starling and work) to transcode to the FLV format and create a jpg thumbnail.

So my question is this: I want to be able to do all these conversions on the local server, but I would like the files to be saved on S3 at the end, in order to save space and bandwidth on my server. How can I use the S3 backend to clip for this? Or, instead, do I have a background task loading on S3 regardless of paperclip after doing all after_save tasks that update the paperclip attributes to reflect the new S3 path?

+5
source share

All Articles