早些时候我使用的是"launchpad.net/goamz/s3",但是对于我的新项目,我使用的是"github.com/goamz/goamz/s3".,桶的put方法有了改变,现在它又有了一个param“选项”
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)上面是我的密码。你能帮我做些什么吗?我怎样才能得到它的价值?
发布于 2017-12-12 12:22:47
选项在s3.go中定义
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{})
https://stackoverflow.com/questions/47772367
复制相似问题