0 Replies Latest reply on Oct 22, 2014 12:36 AM by vick795

    Create FTP connect and upload file is fine in AIR but fail in SWF?

    vick795

      I was have a project. It need to use FTP to upload files. And it works fine when I export to AIR.

      Now.....I want to use it on web. So I export to SWF then....eternal error....

      Below is my code

      Thanks for your patience

       

      private function connect():void{

                  ftpSocket = new Socket();

                 

                  ftpSocket.addEventListener(ProgressEvent.SOCKET_DATA, SocketData);

                  ftpSocket.addEventListener(IOErrorEvent.IO_ERROR, IOError);

                  ftpSocket.addEventListener(SecurityErrorEvent.SECURITY_ERROR, SecError);

                  ftpSocket.addEventListener(Event.CONNECT, SocketConn);

                  ftpSocket.addEventListener(Event.CLOSE, SocketClose);

                  ftpSocket.addEventListener(Event.ACTIVATE, SocketAtivate);

                 

                  ftpSocket.connect(server,21);

                 

                  sendCommand("USER "+this.user);

              }

       

       

      Error Message like this

      *** Security Sandbox Violation ***

      連線至 xx.x.xxx.x:21 已終止 - http://test.com.tw/test.swf?ts=1413962614971不允許

      錯誤: 拒絕 xmlsocket://xx.x.xxx.x:21 的資源請求   由於沒有原則檔權限