Hi, i''ve servers (not connected directly, only by internet), one with a rails app, and another with the big static files. The problem is, to access to one of them file you have to be logged, and when you click on a link the rails app will send you the file, but using the other server. Something like a redirect to download a file, but the real url of the file shouldn''t be displayed. Simple example: I''m the user, i go to the site. I try to insert the url like domain.com/download/3 and the rails app tell me that i have to login, i login, i try another time and the app send me the file xyz.zip. Now, because i''m curious i do a properties on the current download to show where the file is stored, and i see domain.com/download/3, and not the real one which would be domain2.com/files/xyz.com What do you think? Is it possible ? There is send_file, but iirc it''s just for local files. Thanks -- 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 -~----------~----~----~----~------~----~------~--~---
Frederick Cheung
2008-May-15 10:11 UTC
Re: Send a file, is it possible to do something like this?
On 15 May 2008, at 10:35, Xdmx Xdmx wrote:> > Simple example: > I''m the user, i go to the site. I try to insert the url like > domain.com/download/3 and the rails app tell me that i have to > login, i > login, i try another time and the app send me the file xyz.zip. Now, > because i''m curious i do a properties on the current download to show > where the file is stored, and i see domain.com/download/3, and not the > real one which would be domain2.com/files/xyz.com > > What do you think? Is it possible ? There is send_file, but iirc it''s > just for local files.The browser has to know where to get the file from or else it can''t get it. I don''t think you can do this if the 2 servers are distinct (and don''t have any shared storage) unless you do something horrible like download it from the second server & forward it on byte by byte. Fred --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Ryan Bigg (Radar)
2008-May-15 21:54 UTC
Re: Send a file, is it possible to do something like this?
I''ve just recently done something like this, without the having to log in. I''ve created a downloads controller and a download model, the download model keeps track of what files are assigned to what IP and the users have to use the generated URL to get to their download. The cool thing is that it will not show the name of the file. I''m using xsendfile to do this and going through apache. Another great thing is that, unlike send_file, this won''t tie up a Rails request. Very handy if you''re downloading large files. Here''s something that may get you going: http://john.guen.in/past/2007/4/17/send_files_faster_with_xsendfile/ --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Frederick Cheung
2008-May-16 09:37 UTC
Re: Send a file, is it possible to do something like this?
On 15 May 2008, at 22:54, Ryan Bigg (Radar) wrote:> I''ve just recently done something like this, without the having to > log in. > > I''ve created a downloads controller and a download model, the > download model keeps track of what files are assigned to what IP and > the users have to use the generated URL to get to their download. > The cool thing is that it will not show the name of the file. > > I''m using xsendfile to do this and going through apache. Another > great thing is that, unlike send_file, this won''t tie up a Rails > request. Very handy if you''re downloading large files. > > Here''s something that may get you going: > > http://john.guen.in/past/2007/4/17/send_files_faster_with_xsendfile/The problem as i understand it is that the server with the files and the server with the rails app are physically distinct, so send_file XSendfile doesn''t help. Fred> > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Ryan Bigg (Radar)
2008-May-16 10:18 UTC
Re: Send a file, is it possible to do something like this?
Oh foo I didn''t see that in the first line. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Xdmx Xdmx
2008-May-17 14:02 UTC
Re: Send a file, is it possible to do something like this?
Frederick Cheung wrote:> The problem as i understand it is that the server with the files and > the server with the rails app are physically distinct, so send_file > XSendfile doesn''t help. >right, the server aren''t even in the same data center. i''ll hope in the future to move everything in the same one so i''ll use xsendfile :) Thanks anyway :) -- 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 -~----------~----~----~----~------~----~------~--~---