shuishixingyu 发表于 2009-8-5 16:37:02

上传文件参数化

   Action()
       {   web_reg_save_param("FileName",
"LB=obj.fileName = '",
"RB='",
"NotFound=ERROR",
"Search=All",
LAST); lr_think_time(7); web_submit_data("project_file_uploader.jsp",
"Action=http://192.168.0.66:7001/product/jsp/bid/common/upload/project_file_uploader.jsp?projectId=880000000000000328&bidObjectId=null&uploadFileType=1&fileTitle=DSC01971&notes=",
"Method=POST",
"EncType=multipart/form-data",
"TargetFrame=",
"RecContentType=text/html",
"Referer=http://192.168.0.66:7001/product/jsp/bid/common/upload/file_upload.jsp?projectId=880000000000000328&uploadFileType=1",
"Snapshot=t136.inf",
"Mode=HTML",
ITEMDATA,
"Name=file0", "Value=C:\\Documents and Settings\\Administrator\\桌面\\DSC01971.JPG", "File=Yes", ENDITEM,
"Name=fileTitle", "Value=DSC01971", ENDITEM,
LAST); web_custom_request("ProjectFileUploadService",
"URL=http://192.168.0.66:7001/product/ajaxapp/ajaxapp/ProjectFileUploadService",
"Method=POST",
"TargetFrame=",
"Resource=0",
"RecContentType=text/xml",
"Referer=http://192.168.0.66:7001/product/jsp/bid/common/upload/file_upload.jsp?projectId=880000000000000328&uploadFileType=1",
"Snapshot=t137.inf",
"Mode=HTML",
"EncType=",
"Body=<buffalo-call>\n<method>addProjectFile</method>\n<map>\n<type>com.freshpower.bid.bm.model.ProjectFile</type>\n<string>uploadFileType</string>\n<string>1</string>\n<string>fileName</string>\n<string>{FileName}</string>\n<string>fileTitle</string>\n<string>DSC01971</string>\n<string>notes</string>\n<string></string>\n<string>projectId</string>\n<string>880000000000000328</string>\n</map>\n\n</buffalo-call>",
LAST); web_custom_request("UploadMonitor.getUploadInfo.dwr_9",
"URL=http://192.168.0.66:7001/product/dwr/call/plaincall/UploadMonitor.getUploadInfo.dwr",
"Method=POST",
"TargetFrame=",
"Resource=0",
"RecContentType=text/javascript",
"Referer=http://192.168.0.66:7001/product/jsp/bid/common/upload/file_upload.jsp?projectId=880000000000000328&uploadFileType=1",
"Snapshot=t138.inf",
"Mode=HTML",
"EncType=text/plain",
"Body=callCount=1\npage=/product/jsp/bid/common/upload/file_upload.jsp?projectId=880000000000000328&uploadFileType=1\nhttpSessionId=gnqbK46T7pGn4CCXTvSmhyYqrXRvDnQTB2yQrK2lnhVXW2J2Jvzl!1678532456\nscriptSessionId=83FA411202833309E9E6CDCABD3D5414409\nc0-scriptName=UploadMonitor\nc0-methodName=getUploadInfo\nc0-id=0\nbatchId=8\n",
LAST); web_url("purchaseFilesIndex.do",
"URL=http://192.168.0.66:7001/product/struts/bm/purchaseFilesIndex.do?projectId=880000000000000328&type=upload&_MENUID=880000000000000223",
"TargetFrame=",
"Resource=0",
"RecContentType=text/html",
"Referer=http://192.168.0.66:7001/product/POM/bid/proj_left_menu.jsp?sysID=880000000000000568&projectId=880000000000000328",
"Snapshot=t139.inf",
"Mode=HTML",
EXTRARES,
LAST); return 0;       }
请问是否把红色部分用参数代替,就可以进行参数化上传不同的文件了?为什么我这么做后,上传的仍是原来的文件?

kuangquanshui 发表于 2009-8-5 18:20:50

学习了

shuishixingyu 发表于 2009-8-26 21:40:21

有人能说下吗?

泊涯 发表于 2009-8-27 09:29:50

你参数化的文件名称在你本地要先人为的新建对应的文件,这样才能上传

刘顺 发表于 2009-8-27 10:25:12

建议 在录制的时候选用基于Url 的脚步试一试
页: [1]
查看完整版本: 上传文件参数化