Marko
Marko

Reputation: 1617

IE opens file itself instead saving it

So I have a page where people can download an XML file with extension DDOC. In other browsers user can successfully save the file. The browsers wont try to open by itself the file. Is it possible to make the download page so, that IE wouldnt try to open the file itself and would just ask user, what he wants to do (Save, Save As or Open file)? Or is it possible only when IE is set so that it wont try to open itself?

Upvotes: 1

Views: 4389

Answers (3)

Marko
Marko

Reputation: 1617

We found a nice solution: Content-Type to application/force-download and it works like a charm so far:)

Upvotes: 0

Jude Cooray
Jude Cooray

Reputation: 19862

The current mime-type of the downloaded XML file must be text/xml or application/xml. And IE must be opening it directly. Check how you can change the mime type of the file sent to the browser and change it to application/octet-stream (thanx c-smile!). So the keyword you should be searching for is, MIME :)

Upvotes: 1

c-smile
c-smile

Reputation: 27460

Try to configure your server so that file is served as application/octet-stream type. In this case browser will don't know what to do with it and ask user to save it.

Upvotes: 2

Related Questions