Quantcast
Channel: Chilkat Forum - latest questions
Viewing all articles
Browse latest Browse all 1061

Cannot connect to Win IoT Ftp server

$
0
0

I am attempting to connect to RaspberryPi 3 Windows 10 IoT which is running ftpd. I can connect to it using Filezilla without any issues. I installed the latest from NuGet in Visual Studio 2017 Enterprise.

Below is the sample code I am using to attempt to connect. It fails at ftp.ConnectAsync() with:

ChilkatLog: Connect_Ftp2: DllDate: May 29 2017 ChilkatVersion: 9.5.0.68 UnlockPrefix: Anything for 30-day trial Architecture: Little Endian; 32-bit VerboseLogging: 0 ProgressMonitoring: enabled: yes heartbeatMs: 0 sendBufferSize: 65536 --ProgressMonitoring ImplicitSsl: 0 AuthTls: 0 AuthSsl: 0 ftpConnect: Hostname: 10.200.10.207 Port: 21 IdleTimeoutMs: 60000 readCommandResponse: Failed to receive more bytes. Failed to read FTP control channel reply. --readCommandResponse initialStatus: 0 initialResponse: --ftpConnect Failed to connect to FTP server. Failed. --Connect_Ftp2 --ChilkatLog


           Chilkat.Ftp2 ftp = new Chilkat.Ftp2();

            bool success;

            //  Any string unlocks the component for the 1st 30-days.
            success = ftp.UnlockComponent("Anything for 30-day trial");
            if (success != true)
            {
                Debug.WriteLine(ftp.LastErrorText);
                return;
            }

            ftp.Hostname = "10.200.10.207";
            ftp.Username = "User";
            ftp.Password = "Password";
            ftp.Port = 21;

            //  Connect and login to the FTP server.
            success = await ftp.ConnectAsync();
            if (success != true)
            {
                Debug.WriteLine(ftp.LastErrorText);
                return;
            }

            //  Set the transfer mode to ASCII
            success = await ftp.SetTypeAsciiAsync();
            if (success != true)
            {
                Debug.WriteLine(ftp.LastErrorText);
                return;
            }

            //  Change to the remote directory where the file will be uploaded.
            success = await ftp.ChangeRemoteDirAsync("junk");
            if (success != true)
            {
                Debug.WriteLine(ftp.LastErrorText);
                return;
            }

            //  Upload a file.
            string localFilename = "hamlet.xml";
            string remoteFilename = "hamlet.xml";

            //  Turn on session logging for the upload:
            ftp.KeepSessionLog = true;

            success = await ftp.PutFileAsync(localFilename, remoteFilename);
            if (success != true)
            {
                Debug.WriteLine(ftp.LastErrorText);
                return;
            }

            //  View the session log.  You can verify visually that
            //  the transfer was in ascii mode.
            Debug.WriteLine(ftp.SessionLog);

            success = await ftp.DisconnectAsync();

            Debug.WriteLine("File Uploaded!");

Viewing all articles
Browse latest Browse all 1061

Latest Images

Trending Articles



Latest Images