How to download an XML without the browser opening it in another tab

Alloi picture Alloi · Oct 5, 2010 · Viewed 39.7k times · Source

I have an xml file to be downloaded. As you all know when i give the below link

<a href="some.xml">Downlad XML</a>

The XML will open in a new tab displaying it. However I would like to know if there is a way, this can downloaded like other files such as a .zip file

Answer

Mohd Abdul Mujib picture Mohd Abdul Mujib · May 19, 2015

After trying a lot of solutions, This worked for me.

Try to provide a dummy argument to the file link as shown below.

<a href="http://link/to/the/file.xml?dummy=dummy" download>Download Now</a>