Forum: Ruby on Rails x_send_file - What is file path?

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
A21bf3c3bcfebcf4e19ff73d71bbce77?d=identicon&s=25 meltingmind (Guest)
on 2008-11-26 17:21
(Received via mailing list)
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.
81b61875e41eaa58887543635d556fca?d=identicon&s=25 Frederick Cheung (Guest)
on 2008-11-26 17:25
(Received via mailing list)
On Nov 26, 3:01 pm, meltingmind <lucaska...@gmail.com> 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
This topic is locked and can not be replied to.