tags:

views:

84

answers:

0

Hi, I have working on a piece where I give option to user for uploading and later download .xls(MS 2003) and .xlsx(MS 2007) files.

No issues I find while uploading, but while downloading the content, I get below mentioned dialog box while opening the downloaded .xlsx.

Excel found unreachable content.Do you want to recover the contents of this workbook? If you trust the source of this workook, click 'Yes'.

I have set right MIME type for both MS excel types.

response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet") - for .xlsx

AND response.setContentType("application/vnd.ms-excel") - for .xls

then I used mentioned below snippet to set header.

response.setHeader("Content-disposition", "attachment;filename=" +fileName)

Any suggestions/corrections you think I need to go for??