1

I am transferring a file via FTP and want to be able to check if that file already exists...

i guess it is using doesFileExist but can't seem to find example for doing this over FTP

i have google'd etc but can't seem to find the right answer.

can anyone help?

Sam Parrish
  • 1,377
  • 1
  • 11
  • 17
  • Did you ever find out how to do this .. ? – Shailesh Apr 10 '13 at 10:11
  • i ended up downloading the file and checking the amount of characters. if there was <0 (ie- none) then i take that as it didnt exist. the problem i had was deleting the file from the serverside, instead i deleted the contents of the file once done with it, and tested for the file size or character length... – Sam Parrish Apr 18 '13 at 09:15

1 Answers1

1

Two possible answers:

1) The traditional way to check for a file on an FTP server is the SIZE command - if you get a size, the file exists, otherwise you get an error and you know it doesn't exist.

2) Found some code that demonstrates a possible way to do this:

Get file size on FTP download

Hope this helps.

Community
  • 1
  • 1
btx
  • 266
  • 1
  • 4