0

I am using the following code at server side

 return Response.ok(file, MediaType.APPLICATION_OCTET_STREAM*)
                  .header("Content-Disposition", "attachment;filename=somename.xlsx" )
                  .build();

I want to directly open the file in some application (preferably ms-excel) I have tried using inline instead of attachment and I also tried using

@Produces("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet") 

All I am able to do is download and open, I want it to open directly rather than downloading.

Pedro Pereira
  • 312
  • 5
  • 21
Streak
  • 1
  • */ is typed out as mistake in the first line of code, sorry for that. – Streak Mar 08 '18 at 09:42
  • Possible duplicate of [PHPExcel: Automatically download and open an Excel file](https://stackoverflow.com/questions/15189296/phpexcel-automatically-download-and-open-an-excel-file) – Nicola Ambrosetti Mar 08 '18 at 09:46

0 Answers0