再问关于smartupload的问题

lukelan 2005-05-18 01:18:08
使用代码生成的txt文件无法下载(错误是无法找到文件)
如果拷贝或手工新建一个文件到相应的路径却可以下载
从文件的权限看不出有什么不同
String filename = "download/"+this.fileName + ".txt";

SmartUpload upload = new SmartUpload();
upload.initialize(pageContext);

this.query();

if (this.items.size() == 0) {
return;
}

//生成文件
OutputStream wout = new FileOutputStream(filename);

//生成输出字符串
Iterator it = this.items.iterator();
while(it.hasNext()) {
OrderVO vo = (OrderVO)it.next();
String str = "";
str += vo.getSendOrderNo() + ",";
str += vo.getCusNodeCode() + ",";
str += vo.getCusProCode() + ",";
str += vo.getOrderTime() + ",";
str += CM.FormatNumber(vo.getOrderAmount(),"##0.00") + ",";
str += CM.FormatNumber(vo.getProductPrice(),"##0.0000") + ",";
str += CM.FormatNumber(vo.getOrderAmount()*vo.getProductPrice(),"##0.00") + ",";
str += CM.FormatNumber(vo.getCessRatio(),"##0") + ",";
str += vo.getFactoryCode()+"\r\n";

wout.write(str.getBytes());
}
wout.close();

upload.setContentDisposition(null);
upload.downloadFile(filename);
...全文
89 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
lukelan 2005-05-18
  • 打赏
  • 举报
回复
ding

81,095

社区成员

发帖
与我相关
我的任务
社区描述
Java Web 开发
社区管理员
  • Web 开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧