Active2 years ago
Xml file free download - Free XML Editor, Excel 2003 Sample: XML File, MySQL Export Table To XML File Software, and many more programs. How to download an XML without the browser opening it in another tab. Ask Question Asked 8 years, 11 months ago. The macro will download the XML file, save it in.
I have an xml file to be downloaded.As you all know when i give the below link
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
ROMANIA_engineer37.5k2020 gold badges165165 silver badges154154 bronze badges
AlloiAlloi26822 gold badges55 silver badges1010 bronze badges
6 Answers
There's an HTTP header called Content-Disposition, which is defined in RFC1806 as follows:
2.1 The Inline Disposition Type
A bodypart should be marked
inline
if it is intended to be displayed automatically upon display of the message. Inline bodyparts should be presented in the order in which they occur, subject to the normal semantics of multipart messages.2.2 The Attachment Disposition Type
Bodyparts can be designated
attachment
to indicate that they are separate from the main body of the mail message, and that their display should not be automatic, but contingent upon some further action of the user. The MUA might instead present the user of a bitmap terminal with an iconic representation of the attachments, or, on character terminals, with a list of attachments from which the user could select for viewing or storage.In order to put the header message on the xml file, you'd need the access to the server-side. For example using php's header function you could write something like:
If you don't have access to the server-side, you could try the following JavaScript trick that I found Googling (not sure if it would work):
Eugene YokotaEugene Yokota75.6k3939 gold badges190190 silver badges285285 bronze badges
After trying a lot of solutions, This worked for me.
Try to provide a dummy argument to the file link as shown below.
Mohd Abdul MujibMohd Abdul Mujib
7,50144 gold badges4343 silver badges6969 bronze badges
I found that just right clicking on the web browser and selecting 'Save Page As...' does the work.
evoxevox
marc_s606k138138 gold badges11601160 silver badges12921292 bronze badges
Orod SemsarzadehOrod Semsarzadeh
Similar to Mohd's solution above, I was able to use the download attribute as specified by W3 here: http://www.w3schools.com/tags/att_a_download.asp. A cool trick about going this route is that you can specify what you want the downloaded filename to be, if it is different from the filename on the server.
mwopatamwopata
Here is my VBA solution. The macro will download the XML file, save it in macro file's folder and inform the user once the process has been completed:
Ryszard JędraszykRyszard JędraszykHow To Save Xml File
1,33522 gold badges99 silver badges2828 bronze badges