直供头到Amazon S3与FineUploader [英] Supplying Headers To Amazon S3 with FineUploader

查看:130
本文介绍了直供头到Amazon S3与FineUploader的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用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虽然:<一href="http://stackoverflow.com/questions/12557980/unable-to-override-content-disposition-header-in-s3">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.

这篇关于直供头到Amazon S3与FineUploader的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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