Get filepath for FTP upload

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

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

On 25 Jun 2008, at 14:53, Adam T. 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

On 25 Jun 2008, at 15:56, Adam T. 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

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 C. wrote:

On 25 Jun 2008, at 15:56, Adam T. 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

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 C. wrote:

On 25 Jun 2008, at 14:53, Adam T. 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