Using xsendfile

20 views
Skip to first unread message

Tom Rossi

unread,
Jun 5, 2012, 12:43:17 PM6/5/12
to railsmachin...@googlegroups.com
I've followed the instructions here for setting up moonshine_xsendfile:


Now whenever I render a file I get a blank file?  The file is located in the public folder and I have tried using an absolute path as well as a relative path with no luck.

What else should I be looking for?

Thanks!
Tom

Josh Nichols

unread,
Jun 8, 2012, 9:19:32 AM6/8/12
to railsmachin...@googlegroups.com
Hey Tom,

When I've seen this come up, it's usually because of a mis-match between what Rails is setting the x-sendfile as, and the file path that apache server is serving it up as. You would see errors in /var/log/apache2/errors.log though.

From memory, apache uses the full path, and resolves symlinks, so would be like: /srv/app/releases/yyyymmddhhmmss/public/path/to/something. That's why there's the entry like:

configure :xsendfile => {:x_send_file_path => rails_root}

That might depend on the path you are using for send_file though.

Let me know if that helps!

- Josh

--
You received this message because you are subscribed to the Google Groups "Moonshine" group.
To view this discussion on the web visit https://groups.google.com/d/msg/railsmachine-moonshine/-/Q1EOQTc6pKkJ.
To post to this group, send email to railsmachin...@googlegroups.com.
To unsubscribe from this group, send email to railsmachine-moon...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/railsmachine-moonshine?hl=en.

Reply all
Reply to author
Forward
0 new messages