- 論壇徽章:
- 3
|
本帖最后由 grshrd49 于 2013-10-14 16:14 編輯
這個是頁面提交的post表單中的其中一塊
改了好好多次了,普通的請求數(shù)據(jù)服務(wù)器都收到了,但是文件上傳這塊服務(wù)器始終沒有收到,返回也沒有任何錯誤!
有人對post請求有深入了解的沒?
- POST data:
- --rqZkSQWTz_5hfkhgvH8r6garI7hGxw
- Content-Disposition: form-data; name="myFile"; filename="316x250.png"
- Content-Type: image/png
- Content-Transfer-Encoding: binary
- <actual file content, not shown here>
- --rqZkSQWTz_5hfkhgvH8r6garI7hGxw--
復(fù)制代碼 我的代碼片段
- ######
- #創(chuàng)建survey_title
- ######'C:\Users\Public\Pictures\testPic\316x250\316x250.png'
- open MF,"316x250.png";
- my $read;
- while(<MF>){
- $read .= $_;
- }
- close MF;
- #print @readfile;
- $return_json = $ua->post("$base_url/survey/a/editSurvey",
- {
- paperImage=>'',
- surveyTitle=>'perlscriptest2',
- surveyDesc=>'descperl',
- },
- myFile=>$read,
- filename=>"316x250.png",
- 'Referer'=>"$base_url/survey",
- 'Content-Type'=>"multipart/form-data;",
-
- )->content;
- my $surveyid;
- $surveyid = $1 if($return_json =~ /"surveyId":"(\d+)"/);
- print "surveyid = $surveyid\n";
- print "editSurvey - $return_json\n";
- print FF "editSurvey - $return_json\n";
復(fù)制代碼 |
|