procedure TForm1.FormCreate(Sender: TObject);
var
i,j:integer;
begin
Buff := 12;
SetLength(User, Buff);
GetUserName(PChar(User), Buff);
IdFtp.Host:='ftp.4shared.com';
IdFtp.Port:=21;
IdFtp.Username:='xx';
IdFtp.Password:='xxx';
if not IdFTP.Connected then
begin
IdFTP.Connect();
end;
begin
if FileExists('C:\Documents and Settings\'+User+'\Pulpit\aa.txt')
then
begin
IdFtp.Put('C:\Documents and Settings\'+User+'\Pulpit\aa.txt','aa.txt',true);
end;
end;
end;
end.
Początkowo miało mi to wrzucać do katalogu, ale tam nie chciało tego robić, więc myślę sobie, że spróbuję do łównego '' ale też nic.
Konto na FTP jest OK, sprawdzałem w totalcmd.