Search code examples
delphiftpindyindy10

TIdFTP corrupted file after upload


Recently we changed the company that hosts our domain from Windows to Linux hosting. Since then, any file i upload using TIdFTP is uploaded without errors, but when i try to download this file, the file is corrupted. For instance, i upload a ZIP file, and when i try to download, i can't expand the ZIP.

The error won't happen if i use a regular FTP client, like Filezilla.

Is there any configuration i could try in TIdFTP to avoid this issue ?

Nothing changed on my code as below :

    ftp.host := 'ftp.myhost.com';
    ftp.Username := 'myusername';
    ftp.password := 'mypassword';
    ftp.Connect();
    ftp.ChangeDir('public_html/downloads');
    ftp.Put('c:\myfile.zip','myfile.zip');

Thanks


Solution

  • TransferType property value of the IdFTP component should be ftBinary for transferring archives.