1

我使用PDF文件下载了一个excel文件VirtalFile.open() 并成功下载并打开。但问题在于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);
4

0 回答 0