# Upload a file using Net:HTTP multipart post or ActiveResource

**URL:** <https://www.ruby-forum.com/t/upload-a-file-using-net-http-multipart-post-or-activeresource/135583>\
**Category:** Rails\
**Created:** [April 23, 2008, 11:22am UTC](https://www.ruby-forum.com/t/upload-a-file-using-net-http-multipart-post-or-activeresource/135583 "2008-04-23T11:22:57Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jatinder\_S](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/a88e4f/32.png) [@Jatinder\_S](https://www.ruby-forum.com/u/Jatinder_S)\
**Post date:** [April 23, 2008, 11:22am UTC](https://www.ruby-forum.com/t/upload-a-file-using-net-http-multipart-post-or-activeresource/135583/1 "2008-04-23T11:22:57Z")

</div>

Hi Guys,

I am trying to upload a file to a rails server using a ruby script.  
[http://pastie.org/185380](http://pastie.org/185380)

I verified the parameters of the Net:HTTP post request and they seem  
to be right. However the recipient, mongre,l shows following message  
in console and the parameters sent, the file data, is all corrupted.  
oh and one very weird thing happened. the console running mongrel  
looks like following after it recieved the file upload request.

Earlier I was using ActiveResource to upload a file, but then I  
realized that it doesn’t have support for multipart content type  
requests.

Thanks  
Jatinder
