While opening a downloaded(using VirtualFile.open()) excel file, prompts a message for recovery

31 Views Asked by At

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);
0

There are 0 best solutions below