in reply to Re^3: Automation and Java Applet
in thread Automation and Java Applet

Ok, so here's the dump of relevant packets from Wireshark:

*$EY@gJ!?P"YP\3POST /webappUpload/49930-499301239320229 HTTP/1.1 Cookie: vis=p0BuJAXf0OBO3FMD9obUFbycSoTX3TUD2XOyO7aGCTzzjo5WsNn86yr5Tt +b10Ylyk6Nu3/ua4bzpmQmspZghGkXehIQnCk0bqQNm0lXV4jN5CyU5lNyltxXJNJjr62l +0GlVpNf9s2Ic=; __utmx=185998783.00002873392993216020:1:0.000035877605 +79199214:3:1.00003589672086876198:4:1; __utmxx=185998783.000028733929 +93216020:1238293709:2592000.00003587760579199214:1239319412:2592000.0 +0003589672086876198:1239319661:2592000; __utma=185998783.444999910131 +1638000.1238293710.1239163691.1239318674.6; __utmz=185998783.12382937 +10.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none); __qca=118505064 +2-48687324-6578781; gpermlogin=+Q1/fMvu4oPYsMY2dJwoGMiOqJPYNTxwCJZPMu +BUCYCz6KI5fsHldCTiIYfqFCXh; __utmv=185998783.Member; _csuid=47196f595 +1870bda; JSESSIONID=EFDC78AE4E5626E4A69BC7D37D7DC767; JSESSIONID=EFDC +78AE4E5626E4A69BC7D37D7DC767; JSESSIONID=EFDC78AE4E5626E4A69BC7D37D7D +C767; gathersid=www07; ref=direct_www; __utmb=185998783.10.10.1239318 +674; __utmc=185998783; __qcb=777367231 Referer: http://www.gather.com/shareVideos.action Cache-Control: no-cache Connection: Keep-Alive Accept: */* Accept-Encoding: text/html User-Agent: Aurigma Image Uploader JE Host: media-upload.gather.com Content-Length: 761879389 Content-Type: multipart/form-data; boundary=XpK3v82IExIWz9o2ChOlFCPaY8 +F5QqDQ3j7y5 --XpK3v82IExIWz9o2ChOlFCPaY8F5QqDQ3j7y5 Content-Disposition: form-d *$EY@gJ!?P"^jP\0ata; name="memberId" Content-Type: text/plain; charset=UTF-8; Content-Transfer-Encoding: 8b +it 49930 --XpK3v82IExIWz9o2ChOlFCPaY8F5QqDQ3j7y5 Content-Disposition: form-data; name="contentType" Content-Type: text/plain; charset=UTF-8; Content-Transfer-Encoding: 8b +it video --XpK3v82IExIWz9o2ChOlFCPaY8F5QqDQ3j7y5 Content-Disposition: form-data; name="albumId" Content-Type: text/plain; charset=UTF-8; Content-Transfer-Encoding: 8b +it --XpK3v82IExIWz9o2ChOlFCPaY8F5QqDQ3j7y5 Content-Disposition: form-data; name="uploadSessionId" Content-Type: text/plain; charset=UTF-8; Content-Transfer-Encoding: 8b +it 499301239320229 -- *$EY@gJ!?P"hP\2SourceFileCreatedDateTime_1" Content-Type: text/plain; charset=UTF-8; Content-Transfer-Encoding: 8b +it 2009:03:27 04:46:35 --XpK3v82IExIWz9o2ChOlFCPaY8F5QqDQ3j7y5 Content-Disposition: form-data; name="SourceFileLastModifiedDateTime_1 +" Content-Type: text/plain; charset=UTF-8; Content-Transfer-Encoding: 8b +it 2009:03:27 04:46:35 --XpK3v82IExIWz9o2ChOlFCPaY8F5QqDQ3j7y5 Content-Disposition: form-data; name="SourceFileCreatedDateTimeLocal_1 +" Content-Type: text/plain; charset=UTF-8; Content-Transfer-Encoding: 8b +it 2009:03:27 00:46:35 --XpK3v82IExIWz9o2ChOlFCPaY8F5QqDQ3j7y5 Content-Disposition: form-data; name="SourceFileLastModifiedDateTimeLo +cal_1" Content-Type: text/plain; charset=UTF-8; Content-Transfer-Encoding: 8b +it 2009:03:27 00:46:35 --XpK3v82IExIWz9o2ChOlFCPaY8F5QqDQ3j7y5 Content-Disposition: form-data; name="FileName_1" Content-Type: text/plain; charset=UTF-8; Content-Transfer-Encoding: 8b +it Exported.avi --XpK3v82IExIWz9o2ChOlFCPaY8F5QqDQ3j7y5 Content-Disposition: form-data; name="SourceFile_1"; filename="Exporte +d.avi" Content-Type: video/x-msvideo; charset=UTF-8; Content-Transfer-Encodin +g: binary


Here I'm trying to upload a video called Export.avi. I can definitely see that it's sending something, but not sure how to duplicate this POST request in Perl in order to actually send along the file.

Replies are listed 'Best First'.
Re^5: Automation and Java Applet
by Corion (Patriarch) on Apr 10, 2009 at 07:23 UTC

    HTTP::Request? Possibly even HTTP::Request::FromTemplate, although I've never tested it with POST data. Possibly you can also trick WWW::Mechanize into allowing you to set the Content-Type of the file. WWW::Mechanize not setting the Content-Type might or might not be construed as a bug.