FluentFTP icon indicating copy to clipboard operation
FluentFTP copied to clipboard

Empty File

Open Zbawn opened this issue 4 years ago • 3 comments

hi, think you for your code its awsome, im using it to connect to Ftps server, rename and delete is working fine but when i try to upload a file from my folder to ftps files are always empty, i find them on the the FTP server but with size 0 this is my code plz help me i cant find a solution

Private Sub GetCsvFiles()
        Try
            Dim ftps = New FtpClient
            ftps.Host = "111.222.333.444"
            ftps.Credentials = New Net.NetworkCredential("aaaa", "bbbb")
            
            ftps.Port = 990 
           ftps.DataConnectionType = FtpDataConnectionType.PASVEX

            AddHandler ftps.ValidateCertificate, AddressOf OnValidateCertificate
          
            ftps.EncryptionMode = FtpEncryptionMode.Implicit

            ftps.Connect()
       
            ftps.UploadFile("C:\envoisgtms\20212220.zip", "/testt/20212220.zip", FtpRemoteExists.Overwrite, FtpVerify.Retry)
            ftps.DownloadFile("C:\envoisgtms\test3.txt", "/testt/test3.txt")
                ftps.DeleteFile("/testt/20211230.zip")

            If ftps.IsConnected Then
                  ftps.Disconnect()
            End If
        Catch ex As Exception
            Console.WriteLine(ex.Message)
            MsgBox(ex.Message)
        End Try

Zbawn avatar Mar 03 '21 16:03 Zbawn

If you want to accept all certs just use ValidateAnyCertificate = True rather than AddHandler ftps.ValidateCertificate, AddressOf OnValidateCertificate.

robinrodricks avatar Apr 08 '21 06:04 robinrodricks

I have also empty file on remote ftp when I use UploadBytesAsync

svarga91 avatar Jul 24 '22 19:07 svarga91

@svarga91 Please make a new issue and add the detailed FTP logs so we can figure it out.

robinrodricks avatar Jul 25 '22 12:07 robinrodricks

@svarga91 Is this issue still open on your side?

We need a full verbose log to find out why the uploaded file is empty. Perhaps the server is producing some error message, so a server log is also always a good idea in such a situation. At least also state what version of FluentFTP you are using? Or get the current newest version which has more debugging messages in a verbose log.

FanDjango avatar Nov 04 '22 20:11 FanDjango