Skip to content

Verifying Files from FTP to PC  #639

Closed as not planned
Closed as not planned

Description

@Louisj99

FTP OS: Windows

Computer OS: wins 10

FluentFTP Version: Latest as of 30/10/20

Hi, I'm currently trying to verify the files on a PC are the same as the files on the FTP server. I'm trying to use checksum so that the file size doesn't matter however I am yet to come across a method on how to replace files that are existing on the PC but have been updated on the FTP. It downloads new files and deletes files on the PC that are not needed but if the same file already exists it fails to check if it has been updated and needs to be downloaded.

this is what I am currently doing to download and try to check what is on the PC.

` FtpClient client = new FtpClient("12.12.12.12");
			client.Credentials = new NetworkCredential("anonymous", "anonymous");

			
			foreach (FtpListItem item in client.GetListing("/@ExampleLocation"))
			{

		
				if (item.Type == FtpFileSystemObjectType.File)
				{

					
					FtpHash hash = client.GetChecksum(item.FullName);
				}

			} 

			client.Connect();

           // not used atm
			FtpCompareResult compareResult = client.CompareFile(@FileLocation, @"/@ExampleLocation", FtpCompareOption.Checksum);




			string fileLocation = @FileLocation;
            client.DownloadDirectory(fileLocation, @"/@ExampleLocation", FtpFolderSyncMode.Mirror, (FtpLocalExists)FtpVerify.Retry, FtpVerify.Delete);`                           

any help is appreciated, I know this might not be the place to post this but I wasn't sure where else to post it.

Activity

  1. robinrodricks commented on Oct 30, 2020

    @robinrodricks
    Owner
  2. Louisj99 commented on Oct 30, 2020

    @Louisj99
    Author

    Yeah, the only issue atm is that if the name of the file doesn't change then it won't try to reinstall it so yeah a comparedirectory method would work

  3. robinrodricks commented on Sep 19, 2022

    @robinrodricks
    Owner

    Added to the bucket list. We will pick this up as and when we have free time. Comment on this issue if you want us to prioritize it. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      ⌂ 换网址