alist icon indicating copy to clipboard operation
alist copied to clipboard

功能请求:s3 前端上传

Open Sakana-1314 opened this issue 1 year ago • 1 comments

Please make sure of the following things

  • [x] I have read the documentation.
  • [x] I'm sure there are no duplicate issues or discussions.
  • [x] I'm sure this feature is not implemented.
  • [x] I'm sure it's a reasonable and popular requirement.

Description of the feature / 需求描述

s3 前端上传

Suggested solution / 实现思路

生成预签名URL

sess, err := session.NewSession(&aws.Config{
	Endpoint:    aws.String(""),
	Credentials: credentials.NewStaticCredentials("SECRET_ACCESS_ID", "SECRET_ACCESS_KEY", ""),
	Region:      aws.String(""),
})

svc := s3.New(sess)

req, _ := svc.PutObjectRequest(&s3.PutObjectInput{
	Bucket: aws.String(""),
	Key:    aws.String(""),
})
urlStr, err := req.Presign(15 * time.Minute)

实现的困难应该主要在前端

Additional context / 附件

No response

Sakana-1314 avatar Feb 20 '25 09:02 Sakana-1314

不,实现的困难主要在后端,因为上传不像下载,此前从没有考虑过类似 302 的功能,如果要加的话后端的架构得大改

KirCute avatar Feb 20 '25 15:02 KirCute