用web_custom_request实现了txt的上传。
录制上传图片等时,body是乱码,不能识别,不知道怎么处理了。
看了别人说用web_submit_data,尝试了,脚本不报错,但是到系统里看时,没有该附件。
然后我回头,想用web_submit_data实现txt文件的上传,发现也一直不能实现。
ps:我录制出来,一个上传动作,分成了四个函数实现。
web_submit_data("UpLoad.ashx",
"Action=../View/bgyy/xzq/UpLoad.ashx?typepath=/Files/FileUpload/{fileguid}",
"Method=POST",
"RecContentType=text/html",
"Referer=.../ClientBin/Dwkj.Common.Control.FileUploadSilverlight.xap?r={time}",
"Snapshot=t5.inf",
"Mode=HTML",
ITEMDATA,
"Name=type", "Value=6", ENDITEM,
"Name=maxfile", "Value=20", ENDITEM,
LAST);
web_submit_data("UpLoad.ashx_2",
"Action=.../View/bgyy/xzq/UpLoad.ashx?typepath=/Files/FileUpload/{fileguid}",
"Method=POST",
"RecContentType=text/html",
"Referer=.../ClientBin/Dwkj.Common.Control.FileUploadSilverlight.xap?r={time}",
"Snapshot=t6.inf",
"Mode=HTML",
ITEMDATA,
"Name=type", "Value=1", ENDITEM,
"Name=filename", "Value=1.txt", ENDITEM,
"Name=md5", "Value=EB61EEAD90E3B899C6BCBE27AC581660", ENDITEM,
LAST);
web_custom_request("UpLoad.ashx_3",
"URL=../View/bgyy/xzq/UpLoad.ashx?typepath=/Files/FileUpload/{fileguid}&type=2&md5=EB61EEAD90E3B899C6BCBE27AC581660&index=0",
"Method=POST",
"Resource=0",
"RecContentType=text/html",
"Referer=.../ClientBin/Dwkj.Common.Control.FileUploadSilverlight.xap?r={time}",
"Snapshot=t7.inf",
"Mode=HTML",
"EncType=multipart/form-data",
"Body=HELLO",
LAST);
web_submit_data("UpLoad.ashx_4",
"Action=.../View/bgyy/xzq/UpLoad.ashx?typepath=/Files/FileUpload/{fileguid}",
"Method=POST",
"RecContentType=text/html",
"Referer=.../ClientBin/Dwkj.Common.Control.FileUploadSilverlight.xap?r={time}",
"Snapshot=t8.inf",
"Mode=HTML",
ITEMDATA,
"Name=type", "Value=3", ENDITEM,
"Name=md5", "Value=EB61EEAD90E3B899C6BCBE27AC581660", ENDITEM,
"Name=filename", "Value=1.txt", ENDITEM,
LAST);
大括号里的是我手动关联的。
介于上面的代码,我要怎么修改实现图片、word、zip等文件的上传啊?