思路如下:
1.设置接收大小,单位是character
2.保存要接收的内容到参数,后面文件存储的内容来源于这个参数信息
3.获取要下载文件的大小
4.使用fopen(*filename,mode) open a file for buffer I/O,注意,返回值是long类型,请参考帮助文档
5.写文件
6.关闭文件流。
源代码如下:
Act
{
int iflen;
long lfbody;
web_set_max_html_param_len("10000");
web_reg_save_param("Downexe","LB=","RB=",LAST);
web_url("downloadprocess",
"URL=http://www.cn-java.com/download/07.pdf",
"Resource=1",
"RecContentType=application/pdfl",
"Referer=",
LAST);
iflen=web_get_int_property(HTTP_INFO_DOWNLOAD_SIZE);
lr_output_message("%d",iflen);
if(iflen>0){
if((lfbody=fopen("c:\\fetion.pdf","wb"))==NULL)
{
lr_output_message("Error when write file");
return -1;
}
fwrite(lr_ev
lr_output_message("write successful");
fclose(lfbody);
}
return 0;
}