Content-Disposition

Amazon S3 upload add-on.

Content-Disposition

Postby albooth » Mon Jul 05, 2010 6:48 pm

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
albooth
 
Posts: 2
Joined: Mon Jul 05, 2010 6:44 pm

Re: Content-Disposition

Postby support » Tue Jul 06, 2010 6:38 am

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.
User avatar
support
 
Posts: 1398
Joined: Sun Jan 27, 2008 6:19 pm

Re: Content-Disposition

Postby albooth » Tue Jul 06, 2010 12:25 pm

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
albooth
 
Posts: 2
Joined: Mon Jul 05, 2010 6:44 pm

Re: Content-Disposition

Postby support » Wed Jul 07, 2010 7:23 pm

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: 1398
Joined: Sun Jan 27, 2008 6:19 pm

Re: Content-Disposition

Postby support » Wed Jul 07, 2010 9:02 pm

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.
User avatar
support
 
Posts: 1398
Joined: Sun Jan 27, 2008 6:19 pm


Return to JS3Upload



cron

Sitemap | Privacy Statement | Java and all Java-based marks are trademarks or registered trademarks of Sun Microsystems, Inc.
in the U.S. and other countries. All other company and/or product names are the property of their respective owners.