|Subject:||FTP - Get Errors|
|Posted by:||DaveR (dav…@safeauto.com)|
|Date:||Thu, 8 Feb 2007|
Let me begin by saying I have spent many hours researching this problem before resulting to this post,
including purchasing Indy In Depth.
Currently I suspect there is a problem in Indy 10.1.5 GET procedure? My code is currently running in
Indy 10.0.52. When I attempt to run the same code in the newer version I recieve errors.
On GET I recieve "Destination File Already Exists" Error when I am certain it does not. I believe I have found a work around for this by setting CanOverWrite to true and doing my own FileExists check, this seems to be a bug?
My current problem is a read timeout error on GET. The server I am connected to requires the port to be 20021 passive mode. As I step through the code I am seeing LPort with a different value, the IOHandler port is debugging with 20021. My understanding with passive is that everything occurs on one channel? It appears a LPASSIVECL is being cretaed with a different port?
My code is as follows:
Prior to this procedure I have made a secure SSL conneciton and PUT a file on the server, I can also LIST the directory,
this works consistently well. I just cannot GET a file.
ReadTimeOut = 0
DataPort - 20021
DataPortMax - 20021
DataPortMin - 20021
Passive = True
UseTLS = utUseExplicitTLS
Port - 20021
BoundPort - 20021
DefaultPort - 20021
if idFTP.Connected then
cxMemo.Lines.Add('Current Directory: ' + idFTP.RetrieveCurrentDir); -- Confirmed current directory is correct.
idFTP.List(Files, '*.*', True); -- List works fine
cxMemo.Lines.Add('File count: ' + IntToStr(Files.Count));
SendMail(soDevError, 'Error occured FTP not connected ');
if Files.Count > 1 then // List will always contain the directory display file count record
for i := 0 to Files.Count - 1 do
cxMemo.Lines.Add('#' + IntToStr(i) + ': ' + Files.Strings[i]);
if pos('Total number of batches',Files.Strings[i]) > 0 then // FTP list directory will have a footer display
begin // of number of files listed, remove it from the list
if FileExists(FileName) then
SendMail(soDevError, 'FIle already exists - ' + FormatDateTime('MM DD, YYYY', Now),
' File Already Exists - ' + PayFileName + #13 +
' To run more than one file on the same day, the file must be manually retrieved ' + #13 +
' and processed.' );
on E: Exception do
SendMail(soDevError, Run - ' + FormatDateTime('MMMM DD, YYYY', Now),
' Get File Error - ' + E.Message);
cxMemo.Lines.Add('No files in directory');
Any insight will be tremendously appreciated, Thanks!