Priyabrata
Priyabrata

Reputation: 1232

Random file-name after ftp upload in delphi

I am working an application which needs to upload files to server. I am using delphi and TIDFtp to upload files.

Everything works ok, except the file name after upload is randomly generated. The file in my machine is named

test.txt

and after upload its named in the server like File name in the server after upload.

How to fix this ?

Here is my code :

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

Upvotes: 3

Views: 622

Answers (1)

mjn
mjn

Reputation: 36634

Indy Put method has a two-argument version

Try this

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

Upvotes: 4

Related Questions