1 Reply Latest reply on May 20, 2016 3:25 AM by Manel.pi.ferrer

    Filereference IOError #2038 on MAC but not on Windows

    Manel.pi.ferrer Level 1

      Hello everyone,

       

      I have an AIR application developed in Adobe Animate. This application contains a class that uses FileReference to upload files to the server.

      When I install it on Windows,.works perfectly, but if I install it on a Mac, hit the "IOErrorEvent # 2038" error.

       

      Does anyone know why this happens only in MAC? How can I solve that?

       

      I leave part of my code if it helps:

      var myFileReference:FileReference = new FileReference();

      myFileReference.addEventListener(Event.SELECT, selectHandler);

      myFileReference.addEventListener(DataEvent.UPLOAD_COMPLETE_DATA, responseHandler);

      myFileReference.addEventListener(Event.CANCEL, cancelHandler);

      myFileReference.addEventListener(Event.COMPLETE, completeHandler);

      myFileReference.addEventListener(HTTPStatusEvent.HTTP_STATUS, httpStatusHandler);

      myFileReference.addEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler);

      myFileReference.addEventListener(Event.OPEN, openHandler);

      myFileReference.addEventListener(SecurityErrorEvent.SECURITY_ERROR, securityErrorHandler);

      function selectHandler(e:Event):void

      {                              

         var urlToCall = "http://localhost/services/mypage.ashx?param1=value1&param2=value2&param3=value3";

        

         var request:URLRequest = new URLRequest(urlToCall);

         request.contentType = "multipart/form-data";

         try

         {

            myFileReference.upload(request);

            trace("upload");

         }

         catch (error:Error)

         {

            showError("Error uploading file.\nPlease, try again.");

         }

      }

      function cancelHandler(event:Event):void {

         //cancelHandler;

      }

      function httpStatusHandler(event:HTTPStatusEvent):void {

         //httpStatusHandler;

      }

      function ioErrorHandler(event:IOErrorEvent):void {

         showError("IO error uploading file.\Please, try again later.");

      }

      function openHandler(event:Event):void {

         //openHandler";

      }

      function securityErrorHandler(event:SecurityErrorEvent):void {

         showError("Security error uploading file.\Please, try again later.");

      }

      function completeHandler(event:Event):void {

         //uploaded

      }