如何在通过 Amazon s3 API 上传时设置文件权限 [英] How to set the permission on files at the time of Upload through Amazon s3 API

查看:185
本文介绍了如何在通过 Amazon s3 API 上传时设置文件权限的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法在通过Amazon S3 API上传文件时设置文件权限.

Is there any way to set the file permission at the time of uploading files through Amazon S3 API.

在我当前的解决方案中,我可以将文件上传到我的存储桶中,但我无法通过文件属性部分中提到的 URL 查看文件.当我在查询字符串中传递访问密钥时,它正在打开.

In my current solution i am able to upload the file on my bucket but i can not view the file through the URL which is mentioned in the file properties section. It is opening when i am passing access keys in query string.

是否需要在 Amazon S3 中进行任何设置,或者我需要在上传时为所有文件设置权限.

Is there any settings required in Amazon S3 or i need to set the permissions to all the file at the time of upload.

提前致谢.

卡迈勒·康德·潘萨里

推荐答案

在 C# 中,当您创建 >mazon 的响应对象时,您会在响应方法中找到 Addheader.

In C# when you create a response object of >mazon then in response method you will find Addheader.

您需要将标题设置为

response.Addheader("x-amz-acl","public-read");

亚马逊在其网络服务 API 中提供这些方法,请参考.

Amazon providing these methods in its web services API kindly refer that.

这篇关于如何在通过 Amazon s3 API 上传时设置文件权限的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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