首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >基于goamz的aws s3 put方法

基于goamz的aws s3 put方法
EN

Stack Overflow用户
提问于 2017-12-12 12:13:46
回答 1查看 66关注 0票数 0

早些时候我使用的是"launchpad.net/goamz/s3",但是对于我的新项目,我使用的是"github.com/goamz/goamz/s3".,桶的put方法有了改变,现在它又有了一个param“选项”

代码语言:javascript
运行
复制
region := aws.USEast2
connection := s3.New(AWSAuth, region)
bucket := connection.Bucket("XXXXX") // change this your bucket name
path := "mypath" // this is the target file and location in S3
//Save image to s3
err = bucket.Put(path,user_content,content_type, s3.ACL("public-read"), options)

上面是我的密码。你能帮我做些什么吗?我怎样才能得到它的价值?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2017-12-12 12:22:47

选项在s3.go中定义

代码语言:javascript
运行
复制
type Options struct {
    SSE              bool
    Meta             map[string][]string
    ContentEncoding  string
    CacheControl     string
    RedirectLocation string
    ContentMD5       string
    // What else?
    // Content-Disposition string
    //// The following become headers so they are []strings rather than strings... I think
    // x-amz-storage-class []string
}

这些选项在官方S3 api文档中都有详细的记录。

在最简单的情况下,你什么也不能传递。例:bucket.Put(path,user_content,content_type, s3.ACL("public-read"), s3.Options{})

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/47772367

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档