Connecting Tech Pros Worldwide Help | Site Map

get filepath for FTP upload

  #1  
Old June 25th, 2008, 03:58 PM
Member
 
Join Date: Jun 2007
Posts: 47
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.

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


Any help would be appreciated!

Cheers

Adam
  #2  
Old June 25th, 2008, 07:15 PM
Expert
 
Join Date: May 2007
Posts: 213

re: get filepath for FTP upload


Since the uploaded file is a StringIO, I'm not sure how to get the full path. But since it is StringIO, you can read the file data and save it as a new file.
Reply


Similar Threads
Thread Thread Starter Forum Replies Last Post
secure ftp from unix Holly answers 0 September 6th, 2006 08:55 PM
VB.NET - Issues with VB.NET FTP Class to UNIX FTP Server craig.overton@gmail.com answers 9 March 24th, 2006 04:25 PM
FTP - can't upload a file using the MS Example Jen answers 18 November 21st, 2005 05:18 AM
how to show "browse for folder" dialog in html/javascript? strutsng@gmail.com answers 21 October 17th, 2005 08:25 AM