# Multipart form POST

**URL:** <https://www.ruby-forum.com/t/multipart-form-post/164629>\
**Category:** Ruby\
**Created:** [April 3, 2009, 1:35pm UTC](https://www.ruby-forum.com/t/multipart-form-post/164629 "2009-04-03T13:35:48Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![XYXYXY](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/x/e495f1/32.png) [@XYXYXY](https://www.ruby-forum.com/u/XYXYXY)\
**Post date:** [April 3, 2009, 1:35pm UTC](https://www.ruby-forum.com/t/multipart-form-post/164629/1 "2009-04-03T13:35:48Z")

</div>

Hi,

I have a webpage with a multipart form containing among others two  
input fields and one textarea, all three with the same name and all  
three being different ways to submit the same data (an identifier of  
the data, or a file containing the data, or the actual data). I would  
like to submit the form providing data to the textarea and having the  
two other fileds empty.

Building query like:  
q={“name”=\>"", “name”=\>"", name=“data of some sort”}

and using eg Mechanize to submit the form like that:  
resp=agent.post(url,q)

produces error at the server side script.

I’d be thankful for hints how to submit this form.

K

---

<div class="post-metadata">

**Author:** ![XYXYXY](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/x/e495f1/32.png) [@XYXYXY](https://www.ruby-forum.com/u/XYXYXY)\
**Post date:** [April 6, 2009, 10:20am UTC](https://www.ruby-forum.com/t/multipart-form-post/164629/2 "2009-04-06T10:20:42Z")

</div>

> Building query like:  
> q={“name”=\>"", “name”=\>"", name=“data of some sort”}

Is name defined? Or is it supposed to be in quotes?  
Also, the first and second “name” keys will be overwritten by the third.  
I don’t think this actually raises an error, but if one of the first two  
input fields are used, I’m pretty sure the data will be lost.
