Hello
I made a small Flash Interface for generating a specific XML file. When the user is done, curently they click a button, then a text field is populated with the XML output, then they can copy & paste it into a text file.
I understand that there is a way to pass vars to a php script and have it push a file to the user. Does anyone have an example? I think I’m halfway there with this code:
<?php
$filename = $_GET["filename"];
$bytes = filesize("$file");
header("Content-type: text/xml");
header("Content-disposition: attachment; filename=\"$filename\"");
header("Content-length: $bytes");
//Read the file and output to browser
@readfile($file);
//Code to record the download in database
?>
Basically, I have code on the button in flash to getURL this php file, and post the XML as “file” & my desired filename as “filename”. The file saves for the user with the correct filename so I think I’m on the right track, but the file is empty.
What am I missing?
Needless to say, I’ve never really worked with PHP, but I understand it’s syntax is similar to AS. I would really appreciate a brief exmplanation.
Thanks!