在打开下载的(使用VirtualFile.open())Excel文件时,提示您进行恢复

时间:2019-05-15 08:19:53

标签: java virtual-file

我使用VirtalFile.open()下载了一个excel文件 PDF文件并成功下载和打开。但是问题出在excel文件上。

我正在使用播放框架和Java 1.6

 myFile="abc.xlsx";
 contentType = application/vnd.openxmlformatsofficedocument.spreadsheetml.sheet";

VirtualFile vf = VirtualFile.open("myPath/docs/img"+ myFile);
InputStream s = new FileInputStream(vf.getRealFile());
response.setHeader("Cache-Control", "max-age=0");
renderBinary(s, myFile, vf.length(), contentType, false);

0 个答案:

没有答案