# Get filepath for FTP upload

**URL:** <https://www.ruby-forum.com/t/get-filepath-for-ftp-upload/141408>\
**Category:** Rails\
**Created:** [June 25, 2008, 3:50pm UTC](https://www.ruby-forum.com/t/get-filepath-for-ftp-upload/141408 "2008-06-25T15:50:59Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![toro04](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/ea5d25/32.png) [@toro04](https://www.ruby-forum.com/u/toro04)\
**Post date:** [June 25, 2008, 3:50pm UTC](https://www.ruby-forum.com/t/get-filepath-for-ftp-upload/141408/1 "2008-06-25T15:50:59Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![toro04](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/ea5d25/32.png) [@toro04](https://www.ruby-forum.com/u/toro04)\
**Post date:** [June 25, 2008, 3:53pm UTC](https://www.ruby-forum.com/t/get-filepath-for-ftp-upload/141408/2 "2008-06-25T15:53:42Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![toro04](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/ea5d25/32.png) [@toro04](https://www.ruby-forum.com/u/toro04)\
**Post date:** [June 25, 2008, 3:56pm UTC](https://www.ruby-forum.com/t/get-filepath-for-ftp-upload/141408/3 "2008-06-25T15:56:03Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![toro04](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/ea5d25/32.png) [@toro04](https://www.ruby-forum.com/u/toro04)\
**Post date:** [June 25, 2008, 5:01pm UTC](https://www.ruby-forum.com/t/get-filepath-for-ftp-upload/141408/4 "2008-06-25T17:01:53Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![toro04](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/ea5d25/32.png) [@toro04](https://www.ruby-forum.com/u/toro04)\
**Post date:** [June 25, 2008, 5:20pm UTC](https://www.ruby-forum.com/t/get-filepath-for-ftp-upload/141408/5 "2008-06-25T17:20:26Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![toro04](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/ea5d25/32.png) [@toro04](https://www.ruby-forum.com/u/toro04)\
**Post date:** [June 25, 2008, 4:56pm UTC](https://www.ruby-forum.com/t/get-filepath-for-ftp-upload/141408/6 "2008-06-25T16:56:35Z")

</div>

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
