使用回形针直接上传文件到S3 [英] Using Paperclip to direct upload files to S3

查看:195
本文介绍了使用回形针直接上传文件到S3的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

让我有回形针设置了uploadify的东西上传到S3。我做了我的设置,这样的东西被直接加载到S3,然后当它完成帖子发到我的网络服务器,结果......

so I've got paperclip set up with uploadify to upload things to S3. I have made my setup so that stuff gets loaded directly to S3 and then when it's done I post to my webserver the results...

我所得到的回复是该文件的名称和大小。我应该建立自己的处理器或before_post_process法下载从S3文件,以处理它?还是我失去了一些东西,uploadify应该为我提供一个流,它里面的文件,它是做张贴到S3后?

All I get back is the file name and size. am I supposed to build my own processor or before_post_process method to "download" the file from S3 in order to process it? or am I missing something and uploadify should have provided me a stream with the file inside it after it was done posting to S3?

你们如何去直接上传到S3,然后通知你的曲别针支持模式?你有拉从服务器上的文件,做后期处理它们或将回形针处理所有这一切?

How do you guys go about direct uploads to S3 and then notifying your paperclip backed model? Do you have to pull files from the server and do post-processing on them or will paperclip handle all of that?

推荐答案

下面是一对夫妇的博客文章介绍如何做到这一点?

Here are a couple blog posts describing how to do it...

<一个href="http://www.railstoolkit.com/posts/uploading-files-directly-to-amazon-s3-using-fancyupload">http://www.railstoolkit.com/posts/uploading-files-directly-to-amazon-s3-using-fancyupload

<一个href="http://www.railstoolkit.com/posts/fancyupload-amazon-s3-uploader-with-paperclip">http://www.railstoolkit.com/posts/fancyupload-amazon-s3-uploader-with-paperclip

他们用FancyUploader(它使用MooTools的/闪光灯)直接上传到S3,绕过Heroku和他们的可怕30秒请求超时一起,然后用DelayedJob排队后处理任务,如缩图和曲别针做实际的处理的文件。

They use FancyUploader (which uses MooTools/Flash) to upload directly to S3, bypassing Heroku and their dreaded 30 second request timeout all together, and then use DelayedJob to queue up post-processing tasks like thumbnailing and PaperClip to do the actual processing of the files.

如果我能得到这个工作与CarrierWave,我将张贴在GitHub上的一个项目,以分享(在一个星期左右,一旦我得到的时间)

If I can get this working with CarrierWave, I will post up a project on GitHub to share (in a week or so once I get time)

更新

使用Rails 3示例项目,Flash和MooTools的基础FancyUploader直接上传到S3:<一href="https://github.com/iwasrobbed/Rails3-S3-Uploader-FancyUploader">https://github.com/iwasrobbed/Rails3-S3-Uploader-FancyUploader

Sample project using Rails 3, Flash and MooTools-based FancyUploader to upload directly to S3: https://github.com/iwasrobbed/Rails3-S3-Uploader-FancyUploader

使用Rails 3 Sample项目,闪存/ Silverlight的/ GoogleGears /的BrowserPlus和基于jQuery的Plupload直接上传到S3:<一href="https://github.com/iwasrobbed/Rails3-S3-Uploader-Plupload">https://github.com/iwasrobbed/Rails3-S3-Uploader-Plupload

Sample project using Rails 3, Flash/Silverlight/GoogleGears/BrowserPlus and jQuery-based Plupload to upload directly to S3: https://github.com/iwasrobbed/Rails3-S3-Uploader-Plupload

我会加后处理的例子,一旦我有时间。

I will add the post-processing example once I have time.

这篇关于使用回形针直接上传文件到S3的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆