Jump to content

Recommended Posts

Hi there,

 

In short :

i am running a php-script with (post)vars send from  flash builder using a HTTPService.  This script creates a document which is automatically downloaded to the client... 

As long as i used GETvars to open a webpage to the php-script everyting works.  But with POSTvars, it fails...

 

The php-code that generates the document wasn't changed :

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

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

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

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

        readfile($file);

 

Now when i use POSTvars, it still creates a good document, but the download doesn't work.

 

In the .mxml (Flash builder) i have :

 

<fx:Declarations>

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

        <mx:HTTPService id="form1"

                        url="{phpFile}"

                        method="POST"

                        result="handleResult(event)"

                        fault="handleFault(event)"

                        resultFormat="text">

            <mx:request>

                <type>tmp</type>

                <rapport>tmp</rapport>

                <params>tmp</params>

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

    </fx:Declarations>

 

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";

    form1.send(param);

}

 

Any hints on what i am doing wrong?

Thanks in advance

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.