Flash + php, For downloading files

I have this php code:


<?php
// We'll be outputting a XML
header('Content-type: text/xml');

// It will be called myLoam.xml
header('Content-Disposition: attachment; filename="myLoam.xml"');

// The original source
readfile('./files/save.xml');
?>

Which when accessed directly (i.e. myurl.com/download.php), brings up the browser dialog box for downloading files and lets you save the file.

When i try and call it from within flash, it doesn’t seem to do anything. I’m not sure what the best way to call php script from flash is. I’ve been using xml objects to do it so far i.e:


tempXML.send("download.php");

Any ideas as to how I can get this to work?