Random filename after ftp upload in delphi

I am working on an application that needs to upload files to a server. I am using delphi and TIDFtp to upload files.

Everything works fine except for the filename after download. The file on my machine is called

test.txt

and after uploading its name on the server, for example File name in the server after upload.

How to fix it?

Here is my code:

IdFtp1.Host := 'host';
  IdFtp1.Username := 'uname';
  IdFtp1.Password := 'pass';
  IdFtp1.Connect;
  IdFtp1.Put('test.txt');
  IdFtp1.Disconnect;

      

+3


source to share


1 answer


Indy Put method has a two-argument version

try it



IdFtp1.Put('test.txt', 'remote-file.txt');

      

+4


source







All Articles