wininet http post文件上传总是不成功? ~求高手解析~~
职业炒股 2011-08-06 02:17:00 废话不说,直接上包
成功的应该是:
POST http://up.u.115.com/upload HTTP/1.1
Accept: text/*
Content-Type: multipart/form-data; boundary=----------ae0GI3cH2GI3cH2gL6Ef1Ef1GI3ae0
User-Agent: Shockwave Flash
Host: up.u.115.com
Content-Length: 591147
Connection: Keep-Alive
Pragma: no-cache
Cookie: OOFO=%7B%22active_time%22%3A1312610911%2C%22app%22%3A%22u%22%2C%22birthday%22%3A%220000-00-00%22%2C%22gender%22%3A%22%22%2C%22location%22%3A%220%22%2C%22login_ip%22%3A%22218.17.55.167%22%2C%22login_time%22%3A1312610911%2C%22user_id%22%3A%222364079%22%2C%22sign%22%3A%22403fef209c346e1c8da1f63287486270%22%7D; OOFL=wct511%40126.com; OOFA=%2507%2504WRVU%2508%250C%2512r%250DGwQ%2513%250As%251D%2523%255C%251C%250Cq%2540%250A%2527X%2512%2500%2515%250D%2502%2504wPTPLRYZ%250D%2509Q%2507P%2500%2503%2502%2501WU%2503%250C%2500T%250BU%2503%2506%2506Y%2508W%250D%2500QVWU%2506%2507%250E%2503%250B%2501%2507%2500%2505%2503%2501%250E%2500%2502%250A; CUS_2364079=1
------------ae0GI3cH2GI3cH2gL6Ef1Ef1GI3ae0
Content-Disposition: form-data; name="Filename"
vs2010教程.doc
------------ae0GI3cH2GI3cH2gL6Ef1Ef1GI3ae0
Content-Disposition: form-data; name="aid"
1
------------ae0GI3cH2GI3cH2gL6Ef1Ef1GI3ae0
Content-Disposition: form-data; name="cookie"
%07%04WRVU%08%0C%12r%0DGwQ%13%0As%1D%23%5C%1C%0Cq%40%0A%27X%12%00%15%0D%02%04wPTPLRYZ%0D%09Q%07P%00%03%02%01WU%03%0C%00T%0BU%03%06%06Y%08W%0D%00QVWU%06%07%0E%03%0B%01%07%00%05%03%01%0E%00%02%0A
------------ae0GI3cH2GI3cH2gL6Ef1Ef1GI3ae0
Content-Disposition: form-data; name="Filedata"; filename="vs2010教程.doc"
Content-Type: application/octet-stream
(文件内容)
*** FIDDLER: RawDisplay truncated at 16384 characters. Right-click to disable truncation. ***
返回:
HTTP/1.1 200 OK
Server: nginx
Date: Sat, 06 Aug 2011 06:08:45 GMT
Content-Type: text/html; charset=utf-8
Connection: close
Powered-By-YlmF: CN-DG-TEL-UP-6
Content-Length: 938
{"state":1,"data":{"is_user":1,"user_id":"2364079","group_id":"1","aid":1,"cid":0,"user_ip":"218.17.55.167","upload_type":1,"callback":["aid","cid",""],"upload_type_limit":"*","upload_size_limit":1073741824,"upload_onoff":1,"upload_validity":"31","upload_size_remain":9275381917,"temp_file_path":"\/www\/bigupload\/2\/0003131862","temp_file_name":"vs2010\u6559\u7a0b.doc","temp_file_size":590336,"temp_file_sha1":"5FD5C46A547FF0BE8923A80CC3344912448FC8CD","is_share":0,"file_sha1":"5FD5C46A547FF0BE8923A80CC3344912448FC8CD","file_ext":"doc","file_name":"vs2010\u6559\u7a0b.doc","file_name_sort":118,"file_size":590336,"file_description":"","pick_time":"","file_status":1,"file_ptime":1312610925,"file_location":"","file_type":102,"file_id":25364240,"table_id":25364240,"pick_code":"e6u9bya8","ico":"doc","sha1":"5FD5C46A547FF0BE8923A80CC3344912448FC8CD","user_ptime":"2011-08-06","pick_expire":"\u8fc7\u671f","area_id":1,"category_id":0}}
我的是:
POST http://up.u.115.com/upload HTTP/1.1
Accept: text/*
Content-Type: multipart/form-data;boundary=----------CSE1CmcQJYTxR6fq4cvfRuThscWDtG
User-Agent: Shockwave Flash
Host: up.u.115.com
Pragma: no-cache
Content-Length: 590336
Cookie: CUS_2364079=1; OOFL=wct511%40126.com; OOFO=%7B%22active_time%22%3A1312610973%2C%22app%22%3A%22u%22%2C%22birthday%22%3A%220000-00-00%22%2C%22gender%22%3A%22%22%2C%22location%22%3A%220%22%2C%22login_ip%22%3A%22218.17.55.167%22%2C%22login_time%22%3A1312610973%2C%22user_id%22%3A%222364079%22%2C%22sign%22%3A%22b21d5e30826a57cbde39f805f36a75b0%22%7D; LACK1=1; LCCK=1; OOFA=%2507%2504WRVU%2508%250C%2512r%250DGwQ%2513%250As%251D%2523%255C%251C%250Cq%2540%250A%2527X%2512%2500%2515%250D%2502%2504wPTPLRYZ%250D%2509Q%2507P%2500%2503%2502%2501QW%2503%2502%2500%2500PS%2506%255D%2502V%255EV%2505%2501%2500%2500RW%2508US%2500%255D%2504P%2500S%2501V%250EWU%255D
(文件内容)
*** FIDDLER: RawDisplay truncated at 16384 characters. Right-click to disable truncation. ***
返回:
HTTP/1.1 200 OK
Server: nginx
Date: Sat, 06 Aug 2011 06:09:24 GMT
Content-Type: text/html; charset=utf-8
Connection: close
Powered-By-YlmF: CN-DG-TEL-UP-6
Content-Length: 139
{"state":0,"message":"\u670d\u52a1\u5668\u6269\u5c55\u53d1\u751f\u5f02\u5e38\uff0c\u8bf7\u901a\u77e5\u7ba1\u7406\u5458\u3002","code":10016}
这是为什么呢? 难道还有添加什么?