# Downloading the files from specific location

**URL:** <https://www.ruby-forum.com/t/downloading-the-files-from-specific-location/158928>\
**Category:** Rails\
**Created:** [January 29, 2009, 2:28pm UTC](https://www.ruby-forum.com/t/downloading-the-files-from-specific-location/158928 "2009-01-29T14:28:35Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![srikanth](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/f9ae1b/32.png) [@srikanth](https://www.ruby-forum.com/u/srikanth)\
**Post date:** [January 29, 2009, 2:28pm UTC](https://www.ruby-forum.com/t/downloading-the-files-from-specific-location/158928/1 "2009-01-29T14:28:35Z")

</div>

Hi,

I have group of streams in public/data folder.  
Here i want to download the any selected stream from datafolder.

I have tried to download using ‘send\_data’ in my show method of  
controller like below:

send\_data(@stream.location,:filename =\> @stream.name,:disposition =\>  
‘download’)

i have hyperlink called show ,if i press the link it is opening the  
file with stream as content.  
ex:i have cmd.txt in data folder,once i press the link it open cmd.txt  
as a file and in that file it will have filename itself.

here i want to download the actual file.

can any one suggest how to do download from any location and is is  
possible to download with send\_data?

thanks  
Srikanth

---

<div class="post-metadata">

**Author:** ![srikanth](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/f9ae1b/32.png) [@srikanth](https://www.ruby-forum.com/u/srikanth)\
**Post date:** [January 29, 2009, 3:18pm UTC](https://www.ruby-forum.com/t/downloading-the-files-from-specific-location/158928/2 "2009-01-29T15:18:20Z")

</div>

On Thu, Jan 29, 2009 at 3:27 PM, srikanth [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> ‘download’)
> 
> thanks  
> Srikanth
> 
> >

If I’ve understood your question correctly, the file is opening in the  
browser and now presenting the save dialog  
Try using :disposition =\> ‘attachment’

–  
Andrew T.  
[http://ramblingsonrails.com](http://ramblingsonrails.com)  
[http://www.linkedin.com/in/andrewtimberlake](http://www.linkedin.com/in/andrewtimberlake)

“I have never let my schooling interfere with my education” - Mark Twain

---

<div class="post-metadata">

**Author:** ![srikanth](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/f9ae1b/32.png) [@srikanth](https://www.ruby-forum.com/u/srikanth)\
**Post date:** [January 29, 2009, 3:50pm UTC](https://www.ruby-forum.com/t/downloading-the-files-from-specific-location/158928/3 "2009-01-29T15:50:14Z")

</div>

hi,  
thanks for the reply  
result is same i.e actual file is not having any data.

regards  
Srikanth

On Thu, Jan 29, 2009 at 7:46 PM, Andrew T.
