Action()
{
int flen;
long fileContent;
char fileName[20]="";
char *strNumber;
web_set_max_html_param_len("40000");
lr_start_transaction("xiazai");
web_reg_save_param("fcontent",
"LB=",
"RB=",
"Search=Body",
LAST);
web_url("exportReport",
"URL=下载地址的url",
"Resource=1",
"RecContentType=application/msword",
"Referer=",
"Snapshot=t187.inf",
LAST);
flen=
web_get_int_property(HTTP_INFO_DOWNLOAD_SIZE);
strNumber=lr_eval_string( "{NewParam}" );
strcat( fileName,
"c:\\test\\" );
strcat( fileName,
strNumber );
strcat( fileName,
".doc" );
if(flen > 0)
{
fileContent=fopen( fileName,
"wb" );
if(fileContent == NULL){
lr_end_transaction("xiazai", LR_FAIL);
return -1;
}
fwrite( lr_eval_string("{fcontent}"),
flen,
1,
fileContent );
fclose( fileContent );
}
lr_end_transaction("xiazai", LR_AUTO);
return 0;
}