asp.net-mvc – 通过Post和ASP.NET MVC上传Amazon S3
我现在已经徒劳地试了2天才能上传到我的Amazon S3 Bucket.以下是我呈现的表格:
<form action="http://s3.amazonaws.com/MYBUCKETNAME" method="post" enctype="multipart/form-data"> <input type="hidden" name="AWSAccessKeyId" value="MYACCESSKEY" /> <input type="hidden" name="acl" value="private" /> <input type="hidden" name="key" value="UserUploads/TestUser/${filename}" /> <input type="hidden" name="success_action_redirect" value="http://WWW.MYURL.COM/" /> <input type="hidden" name="policy" value="POLICY" /> <input type="hidden" name="signature" value="SIGNATURE" /> <div> Please specify a file,or a set of files: <input type="file" name="file" size="100" /> </div> <input type="submit" value="Upload" /> </form> 我的政策文件如下: { expiration = "2011-12-08T12:00:00.000Z",conditions = [ ["eq","bucket","MYBUCKETNAME"],["eq","acl","private"],["starts-with","$key","UserUploads/TestUser/"],"success_action_redirect","HTTP://WWW.MYURL.COM/"] ] } 我收到以下错误: 有没有人有任何想法,我在这里抓住稻草.还不确定我的Bucket Policy和ACL是否正确. 解决方法
根据
http://doc.s3.amazonaws.com/proposals/post.html#Access_Control
[ "eq","$fieldname","S" ], (注意$前缀). 所以你的政策应该有$in set,你使用“eq”格式 (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
- asp.net – 如何以编程方式覆盖web.config设置
- asp.net – 是否有任何.NET标准用于处理本地化但允许用户自
- asp.net – 根据角色为某些用户提供更强的密码
- asp.net-mvc – 与SmtpClient.UseDefaultCredentials属性混
- asp.net – 使用linq进行Datalist分页
- asp.net – 为什么我的控件获得不同的id命名约定?
- ASP.NET MVC使用Ajax的辅助的解决方法
- asp.net读取和写入txt文件方法
- asp.net-ajax – Ajax脚本管理器和母版页
- asp.net-mvc – 如何在ASP.NET MVC中测试动作过滤器?
- 为什么我需要在ASP.NET控件上调用处理?
- SQLXML初体验:用XML代替T-SQL来操作数据库
- asp.net – ASP.MVC CORE网站的最大上传大小
- asp.net-mvc-3 – Jquery验证器重置$.validator.
- asp.net-mvc-3 – 从MVC 3中使用Razor View引擎的
- asp.net – ASPXGridView ClientSideEvents如何获
- asp.net-mvc – Razor vs Webforms视图引擎,用于
- typescript – 浏览中ts文件的空内容
- asp.net-mvc-4 – MVC4最小参考
- asp.net-mvc – Asp.net页面是否应该在MVC中包含