1 Reply Latest reply on Apr 1, 2008 4:25 PM by Gregory Lafrance

    FileReference.download() problem

    komprador
      Hi, I am trying to write an application to download files from my server.

      My download code is:
      var request:URLRequest = new URLRequest(" http://mysite/download.php");
      fileToDownload = new FileReference();
      fileToDownload.download(request);

      and my download.php is:
      <?php
      header("Content-type:application/pdf");
      // It will be called downloaded.pdf
      header("Content-Disposition:attachment;filename='downloaded.pdf'");
      // The PDF source is in original.pdf
      readfile("original.pdf");
      ?>

      However, it is not working. It is trying to download "download.php" and failing.

      Any help will be appreaciated please?