Forum: Ruby Multipart form POST

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
70c108c0bd4596404d4bfb01d8688b74?d=identicon&s=25 XY$ (Guest)
on 2009-04-03 13:35
(Received via mailing list)
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
82b09b041448e75d040587fa76f240c1?d=identicon&s=25 Shaun Keller (akira)
on 2009-04-06 10:20
> 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.
This topic is locked and can not be replied to.