2 Replies Latest reply on Jan 2, 2009 7:54 PM by flexstone

    How to call a php file from AIR?

    Mauro Martins.
      Hello guys! I am having a problem trying to do an image upload from an AIR application.

      I am uing FileReference and this is what i am doing:

      private function doFile (e:Event) : void {
      var fileReference:FileReference = new FileReference();

      var fileFilter:FileFilter = new FileFilter ("Images", "*.jpg");

      private function fileSelectHandler(event:Event):void {
      trace("You selected a file name " + event.target.name + " that is " + event.target.size + " bytes in size");
      var uploadURL:URLRequest = new URLRequest(" http://www.myurl.com/uploadImage.php");
      var thisFileRef:FileReference = FileReference(event.target);

      In Flash trace i am getting this problem:

      A file IO error has occurred: [IOErrorEvent type="ioError" bubbles=false cancelable=false eventPhase=2 text="Error #2038: File I/O Error. URL: http://www.myurl.com/uploadImage.php" errorID=2038]

      And if i use Service Capture to show the caller get this error:

      <TITLE>403 Forbidden</TITLE>
      You don't have permission to access /uploadImage.php
      on this server.<P>
      <P>Additionally, a 404 Not Found
      error was encountered while trying to use an ErrorDocument to handle the request.
      <ADDRESS>Apache/1.3.41 Server at www.myurl.com Port 80</ADDRESS>

      I think i need to use crossdomain.xml right? I that so, how can i use to make it work for everyone who use my application all around the world without having problems?

      Thank you very much!!