# Download file located outside rails aaplication folder

**URL:** <https://www.ruby-forum.com/t/download-file-located-outside-rails-aaplication-folder/172890>\
**Category:** Rails\
**Created:** [July 29, 2009, 2:01pm UTC](https://www.ruby-forum.com/t/download-file-located-outside-rails-aaplication-folder/172890 "2009-07-29T14:01:46Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![dhaval\_parikh33](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/bcef8e/32.png) [@dhaval\_parikh33](https://www.ruby-forum.com/u/dhaval_parikh33)\
**Post date:** [July 29, 2009, 2:01pm UTC](https://www.ruby-forum.com/t/download-file-located-outside-rails-aaplication-folder/172890/1 "2009-07-29T14:01:46Z")

</div>

hi,

how can i access/download a file located somewhere else outside rails  
application folder? suppose, file is in /tmp/ or /home/some\_folder/ on  
linux, then what should be the path given for send\_file?

-DPP

---

<div class="post-metadata">

**Author:** ![dhaval\_parikh33](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/bcef8e/32.png) [@dhaval\_parikh33](https://www.ruby-forum.com/u/dhaval_parikh33)\
**Post date:** [July 30, 2009, 8:09am UTC](https://www.ruby-forum.com/t/download-file-located-outside-rails-aaplication-folder/172890/2 "2009-07-30T08:09:45Z")

</div>

Dhaval P. wrote:

> hi,
> 
> how can i access/download a file located somewhere else outside rails  
> application folder? suppose, file is in /tmp/ or /home/some\_folder/ on  
> linux, then what should be the path given for send\_file?
> 
> -DPP

one of our perl script generates reports in /tmp/reports and i need to  
download them. can somebody help in this please? is there any risk  
putting outside file path to download function?

-dpp

---

<div class="post-metadata">

**Author:** ![dhaval\_parikh33](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/bcef8e/32.png) [@dhaval\_parikh33](https://www.ruby-forum.com/u/dhaval_parikh33)\
**Post date:** [July 30, 2009, 8:59am UTC](https://www.ruby-forum.com/t/download-file-located-outside-rails-aaplication-folder/172890/3 "2009-07-30T08:59:42Z")

</div>

> **[ActionController::Streaming](https://api.rubyonrails.org/classes/ActionController/Streaming.html)**
>
> Allows views to be streamed back to the client as they are rendered. By default, Rails renders views by first rendering the template and then the layout.

Sijo

---

<div class="post-metadata">

**Author:** ![dhaval\_parikh33](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/bcef8e/32.png) [@dhaval\_parikh33](https://www.ruby-forum.com/u/dhaval_parikh33)\
**Post date:** [July 30, 2009, 2:21pm UTC](https://www.ruby-forum.com/t/download-file-located-outside-rails-aaplication-folder/172890/4 "2009-07-30T14:21:40Z")

</div>

Sijo Kg wrote:

> [ActionController::Streaming](http://api.rubyonrails.org/classes/ActionController/Streaming.html#M000421)
> 
> Sijo

thanks sijo. i had tried that some days back and it didn’t worked that  
time but it worked today… strange. anyways… thanks for your time and  
help.

btw, is there any risk putting the outside rails file path, directly in  
the download function? there is something called “sanitize” in the docs.  
can you or anybody explain a bit about that with some examples?

-dpp
