Action()
{
int flen;
long filedes;
char file[1024]="\0";
char fuzhi[1024]="\0";
char * chNumber=fuzhi;
chNumber=lr_eval_string("{NewParam}");
strcat(file,"c:\\policyNo_");
strcat(file,chNumber);
strcat(file,".txt");
web_set_max_html_param_len("20000000");
web_reg_save_param("fcontent", "LB=", "RB=", "SEARCH=BODY", LAST);
lr_start_transaction("保单下载");
web_url("epolicyDownload.do",
"URL=http://11.0.71.211:9001/web/epolicy/epolicyDownload.do?orderNo={NewParam_orderNo}",
"Resource=1",
"RecContentType=application/octet-stream",
"Referer=http://11.0.71.211:9001/web/web/default.jsp",
"Snapshot=t88.inf",
LAST);
int flen;
unsigned int flen2;
long filedes;
char file[1024]="\0";
char fuzhi[1024]="\0";
char * chNumber=fuzhi;
chNumber=lr_eval_string("{NewParam}");
strcat(file,"c:\\policyNo_");
strcat(file,chNumber);
strcat(file,".txt");
unsigned int recvlen;//定义一个无符号的变量
long policyfile_stream;
web_set_max_html_param_len("20000000");
web_reg_save_param("fcontent", "LB=", "RB=", "SEARCH=BODY", LAST);
//获取响应中的文件长度
flen = web_get_int_property(HTTP_INFO_DOWNLOAD_SIZE);
flen2 = lr_eval_string("{fcontent}");
if(flen > 0){
if((filedes = fopen(file, "wb")) == NULL){
lr_output_message("Open File Failed!");
return -1;
}
fprintf(policyfile_bytes,"%s",flen2);
fclose(policyfile_bytes);
lr_end_transaction("保单下载", LR_PASS);
}else{
lr_end_transaction("保单下载", LR_FAIL);
}
return 0;
}