Whenever i download docx, xlsx ar pptx files from IE, IE will save them as a zip file.
whats wrong? can u help me?
thanks...

Dani AI

Generated

Short answer: .docx/.xlsx/.pptx are Office Open XML packages (actually ZIP archives of XML), so a download manager or a wrong server header can make the browser save them with a .zip extension. In this thread confirmed the culprit was a download manager; earlier replies from and correctly pushed checking the link/URL and how the file is served.

Why this happens
Office Open XML files are ZIP-based containers, so tools that sniff file contents may report them as ZIPs. If the HTTP response lacks a correct MIME type or Content-Disposition filename, or a download manager alters the response, the saved name/extension can be wrong. Microsoft documents the Open XML formats here: Open XML file formats overview.

Quick troubleshooting checklist

  1. Disable any download-manager browser extension (IDM etc.) and re-download.
  2. Test the same link in a different browser or an Incognito window.
  3. Inspect response headers (F12 Network panel or curl -I <url>) — check Content-Type and Content-Disposition.
  4. Ensure the server maps these MIME types correctly:
docx: application/vnd.openxmlformats-officedocument.wordprocessingml.document
xlsx: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
pptx: application/vnd.openxmlformats-officedocument.presentationml.presentation

ASP.NET delivery tip
When sending files from code, set the Content-Type and the Content-Disposition filename before sending the file. Example pattern:

Response.Clear();
Response.ContentType = "application/vnd.openxmlformats-officedocument.wordprocessingml.document";
Response.AddHeader("Content-Disposition", "attachment; filename=\"report.docx\"");
Response.TransmitFile(filePath);
Response.End();

Notes and cautions
If server-side compression, proxy, or antivirus is rewriting headers or content, that can also cause issues. Use the Network inspector to confirm both headers and the raw bytes. For details on Content-Disposition behaviour and filename handling see the MDN reference: Content-Disposition.

Recommended Answers

All 9 Replies

Member Avatar for Member #905211

Where are you downloading them from?

i downloading them with IE browser from web server...

Member Avatar for Member #905211

Where? As in the URL, the link, the thing you click on...

this is my code to downloading file

<a href='<%# Eval ("UrlFile") %>'>Download</a>

with my code i can download doc, xls and ppt.. but if i download docx, xlsx and pptx, IE save them as zip...

please remove eval method and just give the path of file then check
example
<a href=

Member Avatar for Member #905211

sandeepchrs, chances are that it is in a repeater or grid, so no, don't get rid of eval.

finally, the problem solved. it just because I am using IDM for downloading... :)

asp.net downloading code ...<a href="document.htm">Download</a>

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.