1 Reply Latest reply on Jul 5, 2012 1:24 AM by FLexOuhammi

    Flash builder + PHP (Post) + download a file

    dzjoepken Level 1

      Hi there,

      i had a form in flash builder that sends variables in GET to a php-script. This script generates a document dat is downloaded to the client by the following php-code :


              header('Content-Description: File Transfer');

              header("Content-type: text/csv");

              header('Content-Length: ' . filesize($file));

              header('Content-Disposition: attachment; filename=' . basename($file));



      Now i wanted to change my flashbuilder-file so it sends the file to php by POST-vars.  It still generates the correct file, but it isn't downloaded to the client (i use the same code as above).  Can anybody give me a hint on what i'm doing wrong?


      The code that i'm using for sending my params to php :


      In the mxml i have :


              <fx:String id="phpFile">./amfphp/services/persdb/rapport_post.php</fx:String>

              <mx:HTTPService id="form1"










                  </mx:request> </mx:HTTPService>



      And my .as file contains this :

      public function sendCsvForm():void{

          var param:Object = new Object;

          param.type = "Persoon.Rapport";

          param.rapport = "CSVCode";

          param.params =  query3 + "~" + filterQuery + "~csvbestand";




      Thanks in advance for having a look on it