Hello,
how can I check if a file already exists on an FTP server with a function similar to FileSize() in a normal Directoy ?
Best Regards
FTP check if file already exists
Re: FTP check if file already exists
Just open a connection, navigate to the target directory and check with ExamineFTPDirectory()
whether there is a file with the specific name you're looking for. Examples can be found in the help file.
whether there is a file with the specific name you're looking for. Examples can be found in the help file.

Blog: Why Does It Suck? (http://whydoesitsuck.com/)
"You can disagree with me as much as you want, but during this talk, by definition, anybody who disagrees is stupid and ugly."
- Linus Torvalds
Re: FTP check if file already exists
The method with ExamineFTPDirectory () I have already tried. I have about 200 files in a array that I need to check. This takes quite a long time.
Here's an example of my code:
for i=1 to FileCount
If ExamineFTPDirectory(1)
While NextFTPDirectoryEntry(1)
If LCase(FTPDirectoryEntryName(1)) = Lcase(Filename(i))
Debug "File "+Filename(i)+" exist"
Continue
Else
Debug "File "+Filename(i)+" not exist"
EndIf
Wend
EndIf
Next
The code does not run correctly. Can you help me?
Here's an example of my code:
for i=1 to FileCount
If ExamineFTPDirectory(1)
While NextFTPDirectoryEntry(1)
If LCase(FTPDirectoryEntryName(1)) = Lcase(Filename(i))
Debug "File "+Filename(i)+" exist"
Continue
Else
Debug "File "+Filename(i)+" not exist"
EndIf
Wend
EndIf
Next
The code does not run correctly. Can you help me?