Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

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

like image 445
Alloi Avatar asked Oct 05 '10 04:10

Alloi


1 Answers

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>
like image 111
Mohd Abdul Mujib Avatar answered Nov 22 '22 05:11

Mohd Abdul Mujib