2 Replies Latest reply on Dec 17, 2008 7:17 AM by jeroencornelissen

    Transfer Files and Connect to FTP

    rfkrocktk
      Is it possible to connect to FTP and transfer files via Flex and AIR 1.0? Can you build an AIR FTP application?

      - TK
        • 1. Re: Transfer Files and Connect to FTP
          anirudhs Level 2
          Hi,

          It's possible to write a FTP client in actionscript. Take a look at FlexFTP.
          • 2. Re: Transfer Files and Connect to FTP
            jeroencornelissen Level 1
            Has anybody been able to rebuild the FlexFTP? (make it simpeler)

            I've tried it and it almost works fine, the only problem I have is actually uploading a file.

            socket.writeUTFBytes( "STOR "+file.name+"\n");

            This writes an empty file to the ftp in the current working directory (CWD).
            If I try to do it Maliboo's way, with an interval and doing this:

            var ba:ByteArray = new ByteArray();
            sourceFile.readBytes(ba, 0, bufferSize );
            ba.position = ba.bytesAvailable;
            socket.writeBytes(ba, 0, ba.bytesAvailable);
            socket.flush();


            The socket replies with 500 Invalid command: try being more creative



            Can anyone help me?