Question

I have written some code in JSP to download .docx files which is hosted on a Sun One web server. But it is getting downloaded as a .zip file, not a .docx file. I have added the appropriate MIME types in the web server configuration, but I am still facing the problem.

Was it helpful?

Solution

DOCX files are compressed. Download it, and just rename it back to .docx.

From the MS How-to:

Compact files Files are automatically compressed and can be up to 75 percent smaller in some cases. The Open XML Format uses zip compression technology to store documents, offering potential cost savings as it reduces the disk space required to store files and decreases the bandwidth needed to send files via e-mail, over networks, and across the Internet. When you open a file, it is automatically unzipped. When you save a file, it is automatically zipped again. You do not have to install any special zip utilities to open and close files in Office 2010.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top