Application freezes because Indy uses blocking operations. While the code is running, the main message loop is not running, so new messages are not processed until cxButton1Click()
exits. To solve this problem, put the TIdAntiFreeze
component on your TForm
or move the TIdFTP
code to a separate workflow, and then use TIdSync
or TIdNotify
to safely update the user interface if necessary.
The file will be “damaged” if you transfer it in ASCII mode, and not in binary mode. Verify that the TIdFTP.TransferType
property TIdFTP.TransferType
set to ftBinary
. Indy 9 and earlier were ftBinary
by default, but Indy 10 by default instead of ftASCII
(to meet FTP protocol specifications).
source share