From koch at id-team.com Thu Feb 5 04:08:51 2009 From: koch at id-team.com (Christoph Koch) Date: Thu, 05 Feb 2009 10:08:51 +0100 Subject: [s3-dev] Simply downloading s3objects with a save as dialog box Message-ID: <498AACA3.6060305@id-team.com> Hi! I am trying to directly stream an S3Object to a client, without loading it via my web server and then sending it to the client with send_file() or send_data(). At first I was using a simple redirect_to to the url of the s3-object. However I like to have a dialog box with a save as button. I am having this problem because i want to enable downloading jpgs. The redirect_to does not work for me because the browser simply shows the image. Can someone help me out please? I am trying to solve this issue now since 5 days... Brgds Chris From mdchaney at michaelchaney.com Thu Feb 5 09:25:54 2009 From: mdchaney at michaelchaney.com (Michael Chaney) Date: Thu, 5 Feb 2009 08:25:54 -0600 Subject: [s3-dev] Simply downloading s3objects with a save as dialog box In-Reply-To: <498AACA3.6060305@id-team.com> References: <498AACA3.6060305@id-team.com> Message-ID: <3b456edd0902050625h2ae81df1pec1ad7d674dcdf8f@mail.gmail.com> On Thu, Feb 5, 2009 at 3:08 AM, Christoph Koch wrote: > Hi! > > I am trying to directly stream an S3Object to a client, without loading it > via my web server and then sending it to the client with send_file() or > send_data(). At first I was using a simple redirect_to to the url of the > s3-object. However I like to have a dialog box with a save as button. I am > having this problem because i want to enable downloading jpgs. The > redirect_to does not work for me because the browser simply shows the image. Use a content disposition header: MyS3Object.store(asset_name, 'nada', { :content_type => 'text/plain', :content_disposition => "attachment; filename=\"pic.jpg\"" }) Michael -- Michael Darrin Chaney, Sr. mdchaney at michaelchaney.com http://www.michaelchaney.com/