Hi, I''m having trouble getting send_file to work. I''m building a relatively small csv file, and trying to let the user download it. My action to do the download looks like this: def send_the_file @temp_download_file_path = session[:temp_file_path] send_file @temp_download_file_path, :x_sendfile => true, :type => ''text/csv'', :filename => "contacts.csv" end No errors are generated. Log says it is sending it. I wind up with an empty ( 1 byte) file on the other end. I get the same results with and without the "x_sendfile". Any advice on where the file should reside on my server and how to set the necessary permissions to allow send_file to get at it? What else could I be doing wrong? Thanks for any additional help you guys can provide. jp -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Shameless bump. I still really could use some help on this guys! There must be somebody out there who has used this. thanks much, jp -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On Oct 31, 1:49 am, Jeff Pritchard <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> Shameless bump. I still really could use some help on this guys! There > must be somebody out there who has used this. >What''s in the one byte? send_file reads the file (in ruby) and spits the bytes out - the file doesn''t have to be anywhere in particular, but it does need to be readable by your rails process. Have you tried sticking a breakpoint in there and see if you can open/read the file ? (I''d forget about x_sendfile for now) Fred> thanks much, > jp > -- > Posted viahttp://www.ruby-forum.com/.--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Here''s some example code that covers nginx, apache, or plain old send_file: http://github.com/kete/kete/tree/master/app/controllers/private_files_controller.rb Works with 2.1, haven''t tried it with 2.2 RC1 yet. Hope it helps. Cheers, Walter On Fri, Oct 31, 2008 at 2:49 PM, Jeff Pritchard < rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > Shameless bump. I still really could use some help on this guys! There > must be somebody out there who has used this. > > thanks much, > jp > -- > Posted via http://www.ruby-forum.com/. > > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Walter, this worked great. Thanks a million! jp Walter McGinnis wrote:> Here''s some example code that covers nginx, apache, or plain old > send_file: > http://github.com/kete/kete/tree/master/app/controllers/private_files_controller.rb > > Works with 2.1, haven''t tried it with 2.2 RC1 yet. > > Hope it helps. > > Cheers, > Walter > > On Fri, Oct 31, 2008 at 2:49 PM, Jeff Pritchard <-- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Glad I could help. James Stradling was the guy that actually wrote that particular bit of code. On Nov 2, 2008, at 11:41 AM, Jeff Pritchard <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org > wrote:> > Walter, this worked great. Thanks a million! > > jp > > > Walter McGinnis wrote: >> Here''s some example code that covers nginx, apache, or plain old >> send_file: >> http://github.com/kete/kete/tree/master/app/controllers/private_files_controller.rb >> >> Works with 2.1, haven''t tried it with 2.2 RC1 yet. >> >> Hope it helps. >> >> Cheers, >> Walter >> >> On Fri, Oct 31, 2008 at 2:49 PM, Jeff Pritchard < > > -- > Posted via http://www.ruby-forum.com/. > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---