Newsgroups : Borland : borland.public.delphi.internet.winsock : 2005 Jul : Indy FTP: Problems uploading file. Bug?
| Subject: | Indy FTP: Problems uploading file. Bug? |
| Posted by: | "Boris Nienke" (nospam@nsonic.de) |
| Date: | Thu, 7 Jul 2005 17:14:13 |
Hi,
now i'm trying to upload a file via FTP.
i'm doing this:
procedure TForm1.Button2Click(Sender: TObject);
begin
idFTP1.Passive := true;
idFTP1.Username := dfFTPUser.Text;
idFTP1.Password := dfFTPPsw.Text;
idFTP1.Host := dfFTPServer.Text;
idFTP1.Connect();
if idFTP1.Connected then
begin
idFTP1.ChangeDir('/');
idFTP1.Put(edit1.text, ExtractFileName(edit1.text));
idFTP1.Quit;
idFTP1.Disconnect;
showmessage('file uploaded');
end;
end;
Strange thing is: Sometimes it works, sometimes it does not work.
When it doesn't work the error is: "failed to create data connection
socket"
I have installed a small, local FTP-server (Quick'n'Easy FTP Server) on
Windows2000. I can connect/Upload with TotalCommander without any problems.
But with Indy it's strange.
When i look at the log-file of the server i can see, that when it works(!)
that my application has DISCONNECTED from the server before the file is
sent. Why is that?
Of course the "QUIT"-Command gives an error in the server-logfile "Could
not send reply, disconnected"
With totalCommander i'm NOT disconnected until i send the QUIT. Why is indy
disconnecting before/while transfering?
And why do i get an error sometimes and sometimes not?
i'm using Delphi7 BTW
thanks
Boris