put command does not raise an error, but doesnt transfer the file either!

Giganews Newsgroups
Subject: put command does not raise an error, but doesnt transfer the file either!
Posted by:  Dan (dan.parker@_nospam_pro-bel.com)
Date: Thu, 1 Apr 2004

I am using TIdFTP component shipped with Delphi  to download 1 file from one
FTP server, then upload to another.  The code looks something like this:

SrcMemStream := TMemoryStream.Create;
FSourceFTPServer.Get(SrcFile, SrcMemStream , False);
try
  FDestFTPServer.Allocate(SrcMemStream .Size);  //Exception is raised on
this line
except on E: Exception do
  AddToLog('Warning: Could not allocate space on '+FDestFTPServer.Name+'
['+E.Message+']');
end;

FDestFTPServer.Put(SrcMemStream , SrcFile, False); //No exception raised,
but no file put either!

With most FTP Servers this works fine, but with one particular the Allocate
command raises an "Unknown Command" exception and the Put command *seems*
work fine (i.e no exception thrown) but does not actually do anything!

Any help would be greatly appreciated.

Dan

Replies