Thread Error POSTing File in Perl (9 answers)
Opened by comcom at 2014-08-16 19:08

comcom
 2014-08-16 19:08
#176874 #176874
User since
2014-03-16
4 Artikel
BenutzerIn
[default_avatar]
im trying to rebuild a request (File upload), the packed send from the webbrowser looks like this:

Code: (dl )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
-----------------------------596088922920
Content-Disposition: form-data; name="Filedata"; filename="mypic.gif"
Content-Type: image/gif

GIF87aX# *shorted* ¡§\
-----------------------------596088922920
Content-Disposition: form-data; name="session"

92384729384792384729384729384
-----------------------------596088922920
Content-Disposition: form-data; name="method"

put
-----------------------------596088922920--


my per code looks like this:
Code: (dl )
1
2
3
4
5
6
7
8
use WWW::Mechanize;
$agent = WWW::Mechanize->new( cookie_jar => {} );
$agent->post('http://www.kleiderkreisel.de/photo/ajax_photo_action',
[
"Filedata" => ['mypic.gif' => 'C:\Pics\mypic.gif'],
'session' => '92384729384792384729384729384',
'method' => 'put'
]);


sadly this gives me the error "Internal Server Error"... What am i doing wrong?

modedit Editiert von GwenDragon: Tags erweitert
Last edited: 2014-08-17 11:47:48 +0200 (CEST)

View full thread Error POSTing File in Perl