Content-Disposition

Amazon S3 upload add-on.
Post Reply
albooth
Posts: 3
Joined: Mon Jul 05, 2010 6:44 pm

Content-Disposition

Post by albooth »

Hi there...

I am a registered used of the S3 Upload applet (http://www.kensingtontv.com).

It works fine. But I want to be able to set the Content-Disposition on upload. I want to set everything uploaded to "attachment" so when people click on links to files on my site, they will be prompted to download the files (the Save As dialogue).

I am using the "signature" method to validate the uploads.

I tried to add a Content-Disposition line within the signature but that didn't seem to work.

Can you tell me how I might solve this problem?

Regards,

Al Booth
web developer

User avatar
support
Posts: 1503
Joined: Sun Jan 27, 2008 6:19 pm

Re: Content-Disposition

Post by support »

Content-Disposition is not available in 2.6 but it seems to be supported by S3 POST:
http://docs.amazonwebservices.com/Amazo ... Forms.html

The policy should look like:

Code: Select all

{
  "expiration": "2016-01-01T12:00:00.000Z",
  "conditions": [
    {"bucket": "<bucketname>" },
    {"acl": "public-read" },
    ["starts-with", "$key", ""],
    ["starts-with", "$Content-Type", ""],
    ["starts-with", "$Content-Disposition", ""]
  ]
}
but we would need to add an applet parameter to pass Content-Disposition in S3 upload request.

albooth
Posts: 3
Joined: Mon Jul 05, 2010 6:44 pm

Re: Content-Disposition

Post by albooth »

The reason I need it is so I can show the links (temporary links) on a web page and when people click on them I want them to be presented with a "Save As" dialogue.

There are other ways to do this but they cause server load on the web server where the links reside (the files I am deploying are very large).

So... this would be a great feature to add to the applet. I'm sure other people would appreciate it.

If you decide to add this feature... please let me know or post the info here.

Thanks.

Regards,

Al Booth
web developer

User avatar
support
Posts: 1503
Joined: Sun Jan 27, 2008 6:19 pm

Re: Content-Disposition

Post by support »

Sure, we understand the need. We're working on it. Drop an email to support(at)jfileupload(dot)com and they will provide a testing version quickly.

User avatar
support
Posts: 1503
Joined: Sun Jan 27, 2008 6:19 pm

Re: Content-Disposition

Post by support »

Content-Disposition support added in 2.7.

You just need to add the following parameter to enable it:
<PARAM NAME="s3contentdisposition" VALUE="true">

And you need to declare it in the S3 policy:
http://www.jfileupload.com/products/js3 ... rator.html

Code: Select all

{
  "expiration": "2015-06-15T12:00:00.000Z",
  "conditions": [
    {"bucket": "yourbucketnamehere" },
    {"acl": "public-read" },
    ["starts-with", "$key", ""],
    ["starts-with", "$Content-Type", ""],
    ["starts-with", "$Content-Disposition", ""]
  ]
}
Drop an email to support(at)jfileupload(dot)com and they will provide a testing 2.7 version.

Post Reply