Archived Forum Post

Index of archived forum posts


How to know if a file exists in the remote server?

Jul 22 '13 at 08:11


I would like to know if there is a way to know if a file exists in the remote server. My server has a tree with thousands of images, and weekly I need to update only some images, but to consume less upload time, I would like to check the existence of each image prior to upload them. I am using the PutFile method.

I have read about the SyncRemoteTree method, but I believe I can't use it, because I dont't want to upload all files of my local tree, only the files that match a criteria (thumbnail images that my application generates on runtime), and they are copied with a different name to the remote server.

Thanks in advance for any help.




You can use eg: 'Get FTP Directory Listing Information'.

Put the loop into a funtion and at line 'if (CkFtp2_GetIsDirectory(ftp,i) = True) then' call the same function recursively.

I added all this into a string list and then I am syncronising with total flexibility.



Hello Allan,

Thanks for your answer.

Could you share this code?