poi导出excel文件时,如何设置生成文件的可读可写属性
用File
file.setWritable (false);
file.setReadOnly();
我这里用的是:
response.setContentType("application/vnd.ms-excel");
response.setHeader("Content-disposition", "attachment;filename=" + exportFilename);
/* OutputStream ouputStream = response.getOutputStream();
book.write(ouputStream);
ouputStream.flush();
ouputStream.close(); */
OutputStream ouputStream = null;
try{
ouputStream = response.getOutputStream();
book.write(ouputStream);
}catch(Exception e)
{
e.printStackTrace();
}finally{
ouputStream.close();
}
输出的,并没有file呀
并且生成excel是自动就给加了一个只读,