Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem w/NMFTP

Status
Not open for further replies.

ahhchu

Programmer
Sep 19, 2001
38
US
I notice that when I use NMFTP I can receive notification of a successful upload and download ONCE in a session. If I FTP upload I recieve successful notification, if I immediatley do it again I get not notification. Is there a way to reset the process short of opening another session?

Here is the code I use:

var
ftp2: TNMFTP;
begin
ListBox1.AddItem('ftp2 Created',nil);
ftp2:= TNMFTP.Create(Self);
ftp2.OnFailure:= ftp2Failure; //specify error routine

ListBox1.AddItem('ftp2 Prpoerties Set',nil);
ftp2.FirewallType:= FTUser;
ftp2.FWAuthenticate:= false;
ftp2.Host:= '10.0.1.102';
ftp2.ParseList:= False;
ftp2.Passive:= False;
ftp2.Password:= 'admin';
ftp2.Port:= 21;
ftp2.UserID:= 'administrator';

ftp2.Connect;
if ftp2.Connected then
begin
ftp2.Mode(MODE_BYTE);

ListBox1.AddItem('ftp2 Connected',nil);
iProc:= 1; //upload
iUpCnt:= 300;
sUpLoadTitle:= 'TestUpLoadFile' + IntToStr(iUpCnt);
//First Upload
ftp2.upload('testfile',sUpLoadTitle);
ListBox1.AddItem('ftp2 UpLoaded',nil);
//Second Upload
ftp2.upload('testuploadfile1','script\rodney');
//dont get confirmation after 1st transfer

iProc:= 2; //download
iUpCnt:= 301;
sDownLoadTitle:= 'TestUpLoadFile' + IntToStr(iUpCnt);
ftp2.Download('script\rodney','test\testuploadfile100');

//First DownLoad
ftp2.Download(sUpLoadTitle + 'xx',sDownLoadTitle);
ListBox1.AddItem('ftp2 DownLoaded',nil);
//2nd DownLoad, second ftp goes, dont see the listbox
// msg for the second download
ftp2.Download(sUpLoadTitle + 'xx',sDownLoadTitle);
ListBox1.AddItem('ftp2 DownLoaded',nil);
end;
end;

procedure TForm1.ftp2Failure(var Handled: Boolean; Trans_Type: TCmdType);
begin
case Trans_Type of
cmdDownload: begin
ListBox1.AddItem('DownLoad Failed',nil);
Handled:= true;
end;
cmdUpload: begin
if iProc = 1 then
ListBox1.AddItem('UpLoad Failed',nil)
else
ListBox1.AddItem('DownLoad Failed',nil);
Handled:= true;
end;
end; //end case
end;
 
Hello,
I heard that the NMxxx components are rather buggy. Try switching to Indy or ICS componentsets (can be found at torry.net) which are known to be quite stable.

Goodluck
TonHu
 
TonHu
Thanks for the pointer I will take a look at the others. I have put this code into a loop and probably moved 5-10k files with it, with no problems, it seems to be the notification process....
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top