Jump to content

PHP - FLASH - CSV


r.taaffe

Recommended Posts

hi all,

 

okay i have constructed a string in flash and sent it to a php file using the

sendAndLoad("http://myfile.php", myData, "POST") method which sends the data to a php file

in my php file i have

 

<?php

  $exceldata = $_POST['exceldata']; 

$toSave = "$exceldata";

  $fp = fopen("excel_test.csv", "x");

  if(fwrite($fp, $toSave)) echo "writing=Ok";

  else echo "writing=Error";

  fclose($fp);

?>

 

this grabs the data from post and writes a csv file from flash.

 

my question is : i want the "save as" window to pop up and ask where the user wants to save it

as using the above code the csv file is placed in the same directory as the php file.

 

i have tried

  header("Content-type: application/force-download");

but nothing happens as i assume the page is not loaded (serverside)

 

any ideas ?

 

Link to comment
https://forums.phpfreaks.com/topic/37770-php-flash-csv/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.