# X\_send\_file - What is file path?

**URL:** <https://www.ruby-forum.com/t/x-send-file-what-is-file-path/154237>\
**Category:** Rails\
**Created:** [November 26, 2008, 5:21pm UTC](https://www.ruby-forum.com/t/x-send-file-what-is-file-path/154237 "2008-11-26T17:21:39Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![meltingmind](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/2acd7d/32.png) [@meltingmind](https://www.ruby-forum.com/u/meltingmind)\
**Post date:** [November 26, 2008, 5:21pm UTC](https://www.ruby-forum.com/t/x-send-file-what-is-file-path/154237/1 "2008-11-26T17:21:39Z")

</div>

Hello. I’m using x\_send\_file plugin with Apache on a production  
server, but I don’t seem to have the right path to the file I want to  
download. I searched this forum for clues, but I can’t find the  
answer.

This doesn’t seem to work, nor anything else I’ve tried… can anyone  
help?

x\_send\_file(’#{RAILS\_ROOT}/public/downloads/file\_name.mov’)

I keep getting “Cannot read file” error. If I use double quotes on  
the file path, I get a 1 byte file download with the file name… the  
download file definitely exists and is in the right location as I can  
use the built in send\_file to download the file perfectly. But  
because these video files are large, I don’t want to use RoR to  
download them.

---

<div class="post-metadata">

**Author:** ![meltingmind](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/2acd7d/32.png) [@meltingmind](https://www.ruby-forum.com/u/meltingmind)\
**Post date:** [November 26, 2008, 5:25pm UTC](https://www.ruby-forum.com/t/x-send-file-what-is-file-path/154237/2 "2008-11-26T17:25:12Z")

</div>

On Nov 26, 3:01 pm, meltingmind [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Hello. I’m using x\_send\_file plugin with Apache on a production  
> server, but I don’t seem to have the right path to the file I want to  
> download. I searched this forum for clues, but I can’t find the  
> answer.
> 
> This doesn’t seem to work, nor anything else I’ve tried… can anyone  
> help?
> 
> x\_send\_file(‘#{RAILS\_ROOT}/public/downloads/file\_name.mov’)

I don’t know much about x\_send\_file, but you’re using single quotes so  
the #{} isn’t interpolated

Fred
