开发者

Rails 2.3.10, Paperclip and s3 dead slow and would like to Ajax

I'm using Paperclip and s3 to upload a simple Image file on article. I've browse all these tutorials explaining on how to actually make a delayed job, for the images, but i feel that they're too old and perhaps there's an easier way to accomplish this. My question is, what's the "rails" (quick and easy) of accomplishing an flash/ajax upload for a picture of an artic开发者_C百科le model with the following specs.

1 - Only 1 photo is going to be uploaded per article.

2 - The paperclip model handles 2 resizes of original; Thumb which is 120x120 and Normal which is 250x250

And what should i use to "AJAXify" the upload?

Thank you very much!


There are a couple of popular javascript upload handlers which will display upload progress and can resize the original image prior to upload. Plupload and swfupload. Looking for a swfupload url their site is down so maybe plupload is a better bet.

You should still use delayed job as it means the user doesn't need to wait for your server to reprocess the image on s3, after their internet connection has sent it to your server. It's very simple to set up, in fact, there's a delayed_paperclip plugin which handles it all for you.

edit:

Here's a couple of gems that should make swfupload installation easier.

swfupload rails 2 gem

swfupload rails 3 gem

Also a good tutorial on flash upload with session. Be sure to read updates toward end.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜