直供头到Amazon S3与FineUploaderAmazon、直供头到、FineUploader

2023-09-11 09:59:24 作者:独自一人

我使用FineUploader将文件上传到Amazon S3,和我想的内容处置头添加到文件。我曾经尝试这样做(在CoffeeScript中):

I am using FineUploader to upload files to Amazon S3, and I would like to add the Content-Disposition header to the files. I have tried this (in CoffeeScript):

request:
      endpoint: "..."
      accessKey: "...
      customHeaders:
        "Content-Disposition": "attachment;"

这并没有为我工作。什么我应该做的,而不是任何提示?

This hasn't worked for me. Any tips on what I should do instead?

感谢。

推荐答案

正如我在我的评论中提到,这是要解决在的#1214 。

As I mentioned in my comment this is a feature request to be addressed as described in #1214.

在此之前完成,则可以使用AWS SDK与内容处置正确的覆盖头部生成一个签名的URL服务器端,并使用该客户端。这是可能通过S3 API和SDK的一些可能暴露签署URL生成和头覆盖。我注意到,斯卡拉SDK 确实是前者,而不是后者。这里是另一个SO情况下,解决这个在PHP虽然:Unable覆盖的内容部署标头在S3 。

Until that is complete, you can generate a signed URL server-side using the AWS SDK with the proper override header for content-disposition and use that client-side. This is possible via the S3 API, and several SDKs probably expose signed URL generation and header overrides. I noticed that the scala SDK does the former, but not the latter. Here is another SO case that addresses this in PHP though: Unable to override content disposition header in s3.