Hi all,
I’m trying to upload a file to a Form in this way. My Question is, how
to get the imagefile posted correctly.
def uploadpicture(username, password, imagepath)
agent = Mechanize.new
agent.post(“http://www.somesite.com/”,
{ ‘function’ => ‘picture2’,
‘username’ => username,
‘password’ => password,
‘pict’ => ???,
‘pict_to’ => 0,
‘pict_type’ => 0,
‘submit’ => ‘Send’ }) { |page| return page }
end
Thanks and Regards,
T.