Integrations and APIs for Service

Get Involved. Join the Conversation.


    Bibek Jena
    XML Download
    Topic posted December 19, 2018 by Bibek JenaGreen Ribbon: 100+ Points, last edited December 19, 2018, tagged Connect PHP 
    41 Views, 1 Comment
    XML Download
    Download xml file to our local.

    Hi All,

    i want to fetch the data from OsvC database and form a xml and download the same xml to my local folder.

    i was able to create a xml file ,but downloading the same file to my local is not working.

    Tried giving below headers for force download:

    header('Content-type: text/xml');
    header('Pragma: public');
    header('Cache-control: private');
    header('Content-Type: application/force-download');
    header('Content-Disposition: attachment; filename=test.xml');

    Not sure why i am not able to download xml file ,but this is what i tried for downloading .xls file which worked fine for me.

    Any help would be Appreciated.

    Thanks and Regards,

    Bibek Kumar Jena 


    Code Snippet:



    • Luuk

      You can use application/octet-stream as a MIME type. That should force a download.