0

I had a

<a href = ".\<something>.txt"> Download </a>

When I Save the target in Chrome, it saves as TXT. However, when I do the same in IE, it opens a window with the file format changed to HTML.

How do I fix this? Is it a configuration issue on browser or a code issue ?

I know that IE is a bit problematic in using some HTML5 elements

Prateek Narendra
  • 1,837
  • 5
  • 38
  • 67

2 Answers2

1

I've run into a similar problem myself with PDF downloads, that were saved as html files, while it was still a PDF-file. In my case I used a PHP-function to create the file and forgot to exit the code after providing the download to the frontend, which resulted in the script returning a html-result with the filetype ".pdf.html".

I don't know if it's the same case for you, but after declaring the header-data (Content-Type and Content-Disposition) let the script exit and check if that fixes the issue.

Max
  • 24
  • 4
0

Set content type in response headers from server

Prateek Narendra
  • 1,837
  • 5
  • 38
  • 67