Member Avatar

I have the code below for a download file link on a web page I designed. It works fine in Firefox, but will not work in Internet Explorer nor Safari. In those instances, the file is displayed as text rather than opening the File Save As dialog box. How can I code this link so that it will Open the File Save As dialog box in all browsers?

<a href="FavoriteRoutes.gpx" download> Garmin GPX file</a>.


Recommended Answers

All 2 Replies

correct... that is not support on IE or Safari at this time.

To remedy this, you need help server side. If you are using more than just HTML (php,, jsp, etc..) what you can do is on the response specificy to the browser what you want to happen via the headers you send back..

here is an example on how to handle it via

Response.AddHeader("Content-Length", file.Length.ToString());
Response.AddHeader("Content-Disposition", "inline; filename=" + fileName);
Response.ContentType = fileType;
Member Avatar

I am using html only, with a little java script thrown in. Can this be done is java script?

Be a part of the DaniWeb community

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