1

I downloaded an excel file using VirtalFile.open() PDF files and downloading and opening successfully. but issue is with excel file.

I am using play framework and 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);
mate00
  • 2,727
  • 5
  • 26
  • 34
Sara
  • 39
  • 1
  • 1
  • 5

0 Answers0