我单位有一个网页,是在网页上输入文件名后下载相应的文件,我对文件下载进行了抓包,请高手指点一下怎样用编程实现
文件的下载
抓包数据如下:
1.连接时的包
GET /download.html HTTP/1.1
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-shockwave-flash, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, */*
Accept-Language: zh-cn
Accept-Encoding: gzip, deflate
If-Modified-Since: Thu, 19 Mar 2009 23:52:58 GMT
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; InfoPath.2)
Host: 10.115.8.64:9080
Connection: Keep-Alive
Cookie: JSESSIONID=0000aXeaHAYu71Xusb7I-NS13zu:-1
2.按提交按钮后的包
POST /download.jsp HTTP/1.1
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-shockwave-flash, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, */*
Referer: http://10.115.8.64:9080/download.html
Accept-Language: zh-cn
Content-Type: application/x-www-form-urlencoded
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; InfoPath.2)
Host: 10.115.8.64:9080
Content-Length: 21
Connection: Keep-Alive
Cache-Control: no-cache
Cookie: JSESSIONID=0000aXeaHAYu71Xusb7I-NS13zu:-1filename=AI01126100193.接收到的第一个包
HTTP/1.1 200 OK
Server: WebSphere Application Server/5.1
Set-Cookie: JSESSIONID=00007d6ceNa8xyCFKF0CjyHcDX0:-1;Path=/
Cache-Control: no-cache="set-cookie,set-cookie2"
Expires: Thu, 01 Dec 1994 16:00:00 GMT
Content-Type: application/octet-stream;charset=ISO8859-1
Content-Disposition: attachment;filename="AI0112610018"
Content-Length: 38405
Content-Language: en