|
在网上看了下载文件脚本,copy了,但是运行结果说要关联。不知道怎么办,求助。 (有个时候又能运行成功并有正确的下载数据)。不懂是什么原因。
Error -26377: No match found for the requested parameter "files"
脚本如下
lr_start_transaction("down_139");
gg = lr_eval_string("{localtime_now}");
lr_message("139本地当前下载附件时间是:%s",gg);
web_set_max_html_param_len("20000");
web_concurrent_start(NULL);
//获取响应的全部内容,作为文件内容保存
web_reg_save_param("fcontent", "LB=", "RB=", "SEARCH=BODY", LAST);
web_reg_save_param("files","LB=filename=\"","RB=\"","Search=all",LAST);
lr_rendezvous("xiazai");
web_url("1M.rar",
"URL=http://webmail2.n20svrg.139.com/coremail/fcg/ldmsapp/1M.rar?lettsid=VACsNsLLYvLNRzcVkfLLerdTWwjFxiDf&mid=1tbiGwqrk0oSw6wwDQAAsj%250A27%250A154%250A1&funcid=readpart&part=3&filename=1M.rar&download=1",
"Resource=1",
"RecContentType=application/octet-stream",
"Referer=http://webmail2.n20svrg.139.com/coremail/fcg/ldmsapp?funcid=readlett&sid={Siebel_Analytic_search_id2}&mid=1tbiGwqrk0oSw6wwDQAAsj%250A27%250A154%250A1&fid=1&ord=7&desc=1&start=0&funcid=readlett",
"Snapshot=t149.inf",
LAST);
web_concurrent_end(NULL);
strcat(file,"c:\\");
strcat(file,lr_eval_string("{files}"));
flen = web_get_int_property(HTTP_INFO_DOWNLOAD_SIZE);
lr_output_message("dasd:%d",flen);
if(flen > 0)
{
//以写方式打开文件
if((filedes = fopen(file, "wb")) == NULL)
{
lr_output_message("Open File Failed!",lr_eval_string("{fcontent}"));
return -1;
}
//写入文件内容
fwrite(lr_eval_string("{fcontent}"), flen, 1, filedes);
//关闭文件
fclose(filedes);
}
lr_message(lr_eval_string("{fcontent}"));
down_time =lr_get_transaction_duration("down_139");
lr_end_transaction("down_139",LR_AUTO);
lr_output_message("139下载附件用时:%lf",down_time);
[ 本帖最后由 youyikangqiong 于 2010-4-23 17:17 编辑 ] |
|