# Ruby equivalent of filepart

**URL:** <https://www.ruby-forum.com/t/ruby-equivalent-of-filepart/89781>\
**Category:** Ruby\
**Created:** [March 22, 2007, 6:58pm UTC](https://www.ruby-forum.com/t/ruby-equivalent-of-filepart/89781 "2007-03-22T18:58:34Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![siddharthdawara](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/c68b51/32.png) [@siddharthdawara](https://www.ruby-forum.com/u/siddharthdawara)\
**Post date:** [March 22, 2007, 6:58pm UTC](https://www.ruby-forum.com/t/ruby-equivalent-of-filepart/89781/1 "2007-03-22T18:58:34Z")

</div>

I’m looking for a Ruby equivalent of Java’s Jakarta HTTP FilePart.

I basically need to send out a post request that contains an uploaded  
file to a REST API.

Now the client code that they normally use is Jakarta HTTP. Whose  
definition of a multipart post containing a file is here:  
[http://jakarta.apache.org/commons/httpclient/methods/multipartpost.html](http://jakarta.apache.org/commons/httpclient/methods/multipartpost.html)

I need help to do this in Ruby. Anyone has nay thoughts on this?  
Sid.

---

<div class="post-metadata">

**Author:** ![siddharthdawara](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/c68b51/32.png) [@siddharthdawara](https://www.ruby-forum.com/u/siddharthdawara)\
**Post date:** [March 22, 2007, 9:30pm UTC](https://www.ruby-forum.com/t/ruby-equivalent-of-filepart/89781/2 "2007-03-22T21:30:26Z")

</div>

On Fri, Mar 23, 2007 at 02:58:37AM +0900, Siddharth Dawara wrote:

> I’m looking for a Ruby equivalent of Java’s Jakarta HTTP FilePart.
> 
> I basically need to send out a post request that contains an uploaded  
> file to a REST API.
> 
> Now the client code that they normally use is Jakarta HTTP. Whose  
> definition of a multipart post containing a file is here:  
> [HttpClient - Multipart Post Method](http://jakarta.apache.org/commons/httpclient/methods/multipartpost.html)
> 
> I need help to do this in Ruby. Anyone has nay thoughts on this?

If you google for “ruby multipart post” you’ll find some solutions.

I believe also that Rails has some components which can do this.
