Recent

Author Topic: jFTPClient download  (Read 725 times)

dseligo

  • Hero Member
  • *****
  • Posts: 1196
jFTPClient download
« on: December 15, 2023, 05:07:25 am »
I download remote files with jFTPClient component like this:
Code: Pascal  [Select][+][-]
  1. ftp.Download(MyServerPath + MyFile, Self.GetEnvironmentDirectoryPath(DirDownloads)+ '/' + MyFile);

If MyFile doesn't exist on remote server then OnDownload event is called with success set as False (as expected).

Only, the empty file named MyFile is created in location Self.GetEnvironmentDirectoryPath(DirDownloads).
Is this expected?

I just delete the file in case 'success' is False, but I am not sure if this is a bug or is it some Android feature.

Mongkey

  • Sr. Member
  • ****
  • Posts: 430
Re: jFTPClient download
« Reply #1 on: December 16, 2023, 03:15:52 pm »
You could consider checking filesize, you could do on listing file or just like as on your case, empty file, if it is empty then delete by code.

Thank you

dseligo

  • Hero Member
  • *****
  • Posts: 1196
Re: jFTPClient download
« Reply #2 on: December 16, 2023, 03:57:35 pm »
You could consider checking filesize, you could do on listing file or just like as on your case, empty file, if it is empty then delete by code.

Yes, I delete it by code, it's easiest for me.

 

TinyPortal © 2005-2018