# Alternative Download With Amazon S3

**URL:** <https://www.ruby-forum.com/t/alternative-download-with-amazon-s3/121314>\
**Category:** Rails\
**Created:** [November 26, 2007, 8:51pm UTC](https://www.ruby-forum.com/t/alternative-download-with-amazon-s3/121314 "2007-11-26T20:51:41Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ciocan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/e19adc/32.png) [@ciocan](https://www.ruby-forum.com/u/ciocan)\
**Post date:** [November 26, 2007, 8:51pm UTC](https://www.ruby-forum.com/t/alternative-download-with-amazon-s3/121314/1 "2007-11-26T20:51:41Z")

</div>

Hello,

I want to make an alternative download using amazon s3  
I use [http://amazon.rubyforge.org/](http://amazon.rubyforge.org/) gem

I tried

object = AWS::S3::S3Object.find ‘myfile.zip’, ‘mybucket’  
send\_data ob.value, :filename =\> ‘myfile.zip’

and works, it is downloaded the file.

The problem is, if the file is bigger (ie: 10mb or greater), I have to  
wait until all object is loaded (all data is downloaded from S3), then  
it’s prompt me, the save file dialog.

How can I improve this ?

Thanks

---

<div class="post-metadata">

**Author:** ![ciocan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/e19adc/32.png) [@ciocan](https://www.ruby-forum.com/u/ciocan)\
**Post date:** [November 26, 2007, 9:02pm UTC](https://www.ruby-forum.com/t/alternative-download-with-amazon-s3/121314/2 "2007-11-26T21:02:08Z")

</div>

You could require all your users to use a browser that supports  
downloading in the background … or use some kind of waiting or  
pending animation while the file is being retrieved. You know, like  
those pages that use a meta refresh tag and show a message like  
“Please wait while your file is being retrieved, if you don’t see the  
download screen, click here (with some link that just re-executes the  
same link”.

Does that work for you?

–  
James M.

---

<div class="post-metadata">

**Author:** ![ciocan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/e19adc/32.png) [@ciocan](https://www.ruby-forum.com/u/ciocan)\
**Post date:** [November 26, 2007, 9:05pm UTC](https://www.ruby-forum.com/t/alternative-download-with-amazon-s3/121314/3 "2007-11-26T21:05:58Z")

</div>

Mitchell James wrote:

> You could require all your users to use a browser that supports  
> downloading in the background … or use some kind of waiting or  
> pending animation while the file is being retrieved. You know, like  
> those pages that use a meta refresh tag and show a message like  
> “Please wait while your file is being retrieved, if you don’t see the  
> download screen, click here (with some link that just re-executes the  
> same link”.
> 
> Does that work for you?
> 
> –  
> James M.

Thanks James for your fast reply.  
I don’t think if it worked form me in that way. If the file have 100mb,  
the user must wait a lot of time until it’s downloaded.  
I saw this working at [peepcode.com](http://peepcode.com) (when you download a screencast)

---

<div class="post-metadata">

**Author:** ![ciocan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/e19adc/32.png) [@ciocan](https://www.ruby-forum.com/u/ciocan)\
**Post date:** [November 26, 2007, 11:33pm UTC](https://www.ruby-forum.com/t/alternative-download-with-amazon-s3/121314/4 "2007-11-26T23:33:32Z")

</div>

On 26 Nov 2007, at 20:05, Radu C. wrote:

> > James M.
> 
> Thanks James for your fast reply.  
> I don’t think if it worked form me in that way. If the file have  
> 100mb,  
> the user must wait a lot of time until it’s downloaded.  
> I saw this working at [peepcode.com](http://peepcode.com) (when you download a screencast)

I think this rails’ fault: the response won’t get out to the user’s  
web browser until rails has finished, whereas what you want to do is  
to stream it. Not sure how you get round this.

Fred
