Hi Guys, Can anyone advise on how to get get a file''s filepath via a form? I am working on using a form to allow a user to select a file, then the app uses FTP to transfer the file to the server. As part of ftp you must supply it the location/filepath of your file. Any help would be appreciated! Cheers Adam -- 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 -~----------~----~----~----~------~----~------~--~---
forgot to mention, I am using the form element ''file_field'' - which does return a filepath - but not really! eg., say my file lived in: /my/files/burger.jpg but the information in the ''file_field'' is stored as: --- !ruby/object:ActionController::UploadedStringIO content_type: image/jpeg original_filename: burger.jpg original_path: burger.jpg -- 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 25 Jun 2008, at 14:53, Adam Teale wrote:> > forgot to mention, I am using the form element ''file_field'' - which > does > return a filepath - but not really! > > eg., say my file lived in: > /my/files/burger.jpgYou need to write out the content of the upload to a file on disk somewhere and then do your ftp thingie. Fred> > > but the information in the ''file_field'' is stored as: > > --- !ruby/object:ActionController::UploadedStringIO > content_type: image/jpeg > original_filename: burger.jpg > original_path: burger.jpg > > > -- > 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 -~----------~----~----~----~------~----~------~--~---
hi Fred, i am using ftp because it apparently can hangle file transfers > 2gb (unlike the limits of http uploads / apache). Any ideas? Thanks Adam Frederick Cheung wrote:> On 25 Jun 2008, at 14:53, Adam Teale wrote: > >> >> forgot to mention, I am using the form element ''file_field'' - which >> does >> return a filepath - but not really! >> >> eg., say my file lived in: >> /my/files/burger.jpg > > You need to write out the content of the upload to a file on disk > somewhere and then do your ftp thingie. > > Fred-- 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 25 Jun 2008, at 15:56, Adam Teale wrote:> > hi Fred, > > i am using ftp because it apparently can hangle file transfers > 2gb > (unlike the limits of http uploads / apache). >Oh, you want the users'' browser to ftp the file over to your server? that doesn''t seem very likely. I believe what the browser tells the server about fileuploads is dependant on browsers - some give a full path, others don''t Fred> Any ideas? > > Thanks > > Adam > > Frederick Cheung wrote: >> On 25 Jun 2008, at 14:53, Adam Teale wrote: >> >>> >>> forgot to mention, I am using the form element ''file_field'' - which >>> does >>> return a filepath - but not really! >>> >>> eg., say my file lived in: >>> /my/files/burger.jpg >> >> You need to write out the content of the upload to a file on disk >> somewhere and then do your ftp thingie. >> >> Fred > > -- > 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 -~----------~----~----~----~------~----~------~--~---
Hi Fred Yeah that''s what i would like to do! Good to know that it is browser dependent Thanks for your help! Adam Frederick Cheung wrote:> On 25 Jun 2008, at 15:56, Adam Teale wrote: > >> >> hi Fred, >> >> i am using ftp because it apparently can hangle file transfers > 2gb >> (unlike the limits of http uploads / apache). >> > Oh, you want the users'' browser to ftp the file over to your server? > that doesn''t seem very likely. > I believe what the browser tells the server about fileuploads is > dependant on browsers - some give a full path, others don''t > > Fred-- 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 -~----------~----~----~----~------~----~------~--~---