14. 12. 2010
05. 12. 2010
19. 11. 2010
Anyway, since my posts Uploading files directly to Amazon S3 using FancyUpload and FancyUpload Amazon S3 Uploader with Paperclip I encapsulated the uploader Javascript in its own class (FancyUpload3.S3Uploader) and simplified the rails helper. I also updated the uploader example app using the new code. Feel free to use it, share it and improve it!
25. 08. 2009

Conveniently, paperclip already has a S3 storage module built in. However it assumes that files are first uploaded to the webserver and then to S3. So to make paperclip work with files that are already uploaded to S3 I needed to slightly modify the S3 module in paperclip.
12. 08. 2009

Commonly, when using S3 as a data storage with rails, e.g. with paperclip, files are first uploaded to the webserver, potentially a post process follows and finally the files are uploaded to S3. The obvious advantage of directly uploading to S3 is that each file is only uploaded once (for files that don't require post processing). Another advantage is that the webserver is not touched at all saving its resources for serving pages.
Rails Cache Sweeper Confusion
I am a bit confused about the cache sweeper approach Rails takes. Why is cache expiration tied to the controllers? It doesn't make sense to me. Cached pages and fragments usually depend on model states. The cache doesn't care about which actions create, change or destroy the relevant model(s). So using a normal observer seems to be the best choice to me for expiring caches. This way updating models from within rake tasks for example also correctly expires the cache.
Comments: 0
Read all...
05. 12. 2010
HTML 5 Ajax History and Adress Bar Integration
Today I was searching for a way to change the url in the browser's address bar for a Rails application I'm working on. Why would I need to do that? Well, my app uses ajax to setup various views of a page and I want users to be able to bookmark each individual view. I was not having much hope to find a solution as I remembered reading before that it is not possible to change the address bar. However, what I found was even more: not only is it possible to change the address bar, but additionally you can easily make the browser's back button work properly with pages that load content using ajax requests. The caveat is that the technique I found only works with the very latest browsers that support the HTML 5 history interface, like the latest versions of Chrome and Safari for example. However, there are fallback solutions for older browsers out there like history.js.
Comments: 0
Read all...
19. 11. 2010
Rails Amazon S3 Uploader with Progress Bar (2010 Update)
More than a year ago I wrote about an S3 uploader I made for rails, which is based on the great FancyUpload multiple file uploader. This uploader is still my first choice when it comes to uploading files directly to Amazon's S3 storage from within a rails application. Any other solution I found so far was lacking in some or another aspect.Anyway, since my posts Uploading files directly to Amazon S3 using FancyUpload and FancyUpload Amazon S3 Uploader with Paperclip I encapsulated the uploader Javascript in its own class (FancyUpload3.S3Uploader) and simplified the rails helper. I also updated the uploader example app using the new code. Feel free to use it, share it and improve it!
Comments: 22
Read all...
25. 08. 2009
FancyUpload Amazon S3 Uploader with Paperclip
In the previous (and first) post on this Blog I wrote about how to to upload files directly to Amazon S3 using FancyUpload. This post describes how to extend the uploader so that for each file successfully uploaded to S3 a rails model with a paperclip attachment (the uploaded file) is generated. This is useful for keeping track of the uploaded files from within a rails application and for applying post processes like thumbnail generation. I chose the paperclip plugin because I find it provides the easiest way for adding attachments to a rails model.
Conveniently, paperclip already has a S3 storage module built in. However it assumes that files are first uploaded to the webserver and then to S3. So to make paperclip work with files that are already uploaded to S3 I needed to slightly modify the S3 module in paperclip.
Comments: 6
Read all...
12. 08. 2009
Uploading files directly to Amazon S3 using FancyUpload
I'm happy to share some pieces of code I created to upload files directly to Amazon's S3 data storage, using the great flash based uploader FancyUpload.
Commonly, when using S3 as a data storage with rails, e.g. with paperclip, files are first uploaded to the webserver, potentially a post process follows and finally the files are uploaded to S3. The obvious advantage of directly uploading to S3 is that each file is only uploaded once (for files that don't require post processing). Another advantage is that the webserver is not touched at all saving its resources for serving pages.
Comments: 23
Read all...
