简体   繁体   English

如何在Ruby on Rails中生成S3访问策略

[英]How to generate an S3 Access policy in Ruby on Rails

Server side is Rails. 服务器端是Rails。

Client side is Flash, users will upload directly to S3 客户端是Flash,用户将直接上传到S3

I need a flexible way to generate S3 policy files, base64 encode them, and then distribute the resulting signed policy to the client. 我需要一种灵活的方法来生成S3策略文件,对它们进行base64编码,然后将生成的签名策略分发给客户端。

Is there a good library/gem for this, or do I need to roll my own? 是否有一个不错的库/宝石库,还是我需要自己动手?

I'll be using paperclip to store the file, as per: http://www.railstoolkit.com/posts/fancyupload-amazon-s3-uploader-with-paperclip 我将使用回形针存储文件,如下所示: http : //www.railstoolkit.com/posts/fancyupload-amazon-s3-uploader-with-paperclip

I've had a look at: 我看了看:

These look like they'll help me get bits done, but I can't tell if they'll help me generate flexible policies. 这些看起来可以帮助我完成工作,但是我无法确定它们是否可以帮助我生成灵活的策略。

EDIT: Going to give the "Generate an upload signature..." bit here a shot: http://www.kiakroas.com/blog/44/ 编辑:这里要给“生成一个上传签名...”做个尝试: http : //www.kiakroas.com/blog/44/

这是一个示例项目,说明如何使用Rails 3,Flash / Silverlight / GoogleGears / BrowserPlus和基于jQuery的Plupload直接上传到S3: https//github.com/iwasrobbed/Rails3-S3-Uploader-Plupload

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM