Hello, I have XML files stored in a TEXT MYSQL Field. I would like to be able to download those files by clicking on some links. My question is, do I have to create a file on the server from the TEXT Field before downloading or is there a way to download directly the content of the TEXT Fields in a file on the client machine? Thx
ryujin😕
you can do it without creating a file on the server. use PHP's header() command. see the outputting a PDF example and substitute your DB code for the
readfile('original.pdf');
bit
thnank you very much, here is the code:
$xml = "<xml>xml code</xml>"; $filename = "myfile.xml"; header("Content-type: application/xml"); header("Content-Disposition: attachment; filename=$filename"); echo $xml;
ryujin:p