Board index » delphi » how do you abort a file transfer properly using NMFTP fastnet component

how do you abort a file transfer properly using NMFTP fastnet component

What is the proper way to abort the uploading of a file using this control.

When I use "nmftp.abort" it will always give an access violation in memory
address 00000000.

The program will continue to function I can resend but I always get that
error message.

I tried using the "nmftp.disconnect" which doesn't give the error message
but it won't let me resend the file, I am assuming when you disconnect the
file remains "locked" on the local computer since I can't even open it until
I close the program.

Any suggestions?

 

Re:how do you abort a file transfer properly using NMFTP fastnet component


<SNIP>

Quote

> Any suggestions?

Drop use of the NetMasters components and use Indy or ICs. The NM
components are notorious for their bugs and you get source code with
the other two.

Re:how do you abort a file transfer properly using NMFTP fastnet component


where would I get either of thoese? (url)

Quote
"Eddie Shipman" <delphi_dev@fake_email_address.com> wrote in message

news:MPG.1863c0f3723297cc989956@forums.borland.com...
Quote
> <SNIP>

> > Any suggestions?

> Drop use of the NetMasters components and use Indy or ICs. The NM
> components are notorious for their bugs and you get source code with
> the other two.

Re:how do you abort a file transfer properly using NMFTP fastnet component


Quote
> where would I get either of thoese? (url)

Indy: http://www.nevrona.com/indy/
IC: http://www.overbyte.be/

Good luck,
Stephane

Re:how do you abort a file transfer properly using NMFTP fastnet component


Quote
On Fri, 13 Dec 2002 08:23:55 +0000, Galdran wrote:
> where would I get either of thoese? (url)

www.nevrona.com/indy

johannes

Re:how do you abort a file transfer properly using NMFTP fastnet component


Okay, I installed the new component and of course now I have a new problem.

The reason I used the fastnet component is because I liked the fact you
could cancel the procedure anytime, with the new indy component you have to
wait for it to upload, your program locks ups until it finishes the PUT
command.

What I want to be able to do is cancel that, mid transfer.

I know there must be a way to do this.

Quote
"Galdran" <gald...@hotmail.com> wrote in message

news:3dfa01b2$1@newsgroups.borland.com...
Quote
> What is the proper way to abort the uploading of a file using this
control.

> When I use "nmftp.abort" it will always give an access violation in memory
> address 00000000.

> The program will continue to function I can resend but I always get that
> error message.

> I tried using the "nmftp.disconnect" which doesn't give the error message
> but it won't let me resend the file, I am assuming when you disconnect the
> file remains "locked" on the local computer since I can't even open it
until
> I close the program.

> Any suggestions?

Re:how do you abort a file transfer properly using NMFTP fastnet component


Quote
Galdran <gald...@hotmail.com> wrote in message

news:3dfa2c67$1@newsgroups.borland.com...

Quote
> Okay, I installed the new component and of course now I have a new
problem.

> The reason I used the fastnet component is because I liked the fact
you
> could cancel the procedure anytime, with the new indy component you
have to
> wait for it to upload, your program locks ups until it finishes the
PUT
> command.

> What I want to be able to do is cancel that, mid transfer.

> I know there must be a way to do this.

There is an abort method.

"How can I call it if my program is locked up!"

Run the TidFTP in a thread.

Rgds,
Martin

Re:how do you abort a file transfer properly using NMFTP fastnet component


Okay, i'll have to figure out how to do threads.

Quote
"Martin James" <mjames_fal...@dial.pipex.com> wrote in message

news:3dfa3588@newsgroups.borland.com...
Quote

> Galdran <gald...@hotmail.com> wrote in message
> news:3dfa2c67$1@newsgroups.borland.com...
> > Okay, I installed the new component and of course now I have a new
> problem.

> > The reason I used the fastnet component is because I liked the fact
> you
> > could cancel the procedure anytime, with the new indy component you
> have to
> > wait for it to upload, your program locks ups until it finishes the
> PUT
> > command.

> > What I want to be able to do is cancel that, mid transfer.

> > I know there must be a way to do this.

> There is an abort method.

> "How can I call it if my program is locked up!"

> Run the TidFTP in a thread.

> Rgds,
> Martin

Re:how do you abort a file transfer properly using NMFTP fastnet component


Quote
Galdran <gald...@hotmail.com> wrote in message

news:3dfa39e8$1@newsgroups.borland.com...

Quote
> Okay, i'll have to figure out how to do threads.

Well, if it's any help, here's an FTP put thread using Indy.
Obviously, it won't compile becasue it's part of a complete project &
loadsa stuff unresolved but it maybee gives a basic idea.  This unit
was written to contiunually put the same file onto a remote server,
over & over again, with the intention of loading the network uplink.
Because of the threading, I had no problem running lots of FTPputs,
FTPgets, HTTPgets and pings, all at once.

Rgds,
Martin

*************************************************

unit FTPputThread;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms,
Dialogs,
   serConst, ExtCtrls, StdCtrls, Grids, Buttons, OleCtrls, SHDocVw,
Gauges,
  ComCtrls, AfViewers, NMecho, mailbox,
  IdBaseComponent, IdComponent,IdTCPConnection, IdTCPClient, IdFTP;

type

  TputThread = class(TThread)
  private
    { Private declarations }
  public
    abortFlag:boolean;
    myForm:Tcomponent;
    fileName:string;
    filePath:string;
    remoteName:string;
    localName:string;
    fSize:integer;
    totalTx:integer;
    myHost:string;
    myUserID:string;
    myPassword:string;
    disconnectWait:integer;
    PTimeOut:integer;
    putFTP:TidFTP;
    startTime:TTimeStamp;
    endTime:TTimeStamp;
    procedure startXfer (sender:Tobject);
    procedure PacketTx(Sender: TObject; AWorkMode: TWorkMode;
       const AWorkCount: Integer);
    procedure xferStatus(Sender: TComponent; Status: String);
    procedure xferError (Sender:TComponent;Errno:Word;Errmsg:string);
    procedure putComplete(Sender: TObject; AWorkMode: TWorkMode);
    procedure Execute; override;
  end;

implementation

uses loadForm;

var rMyForm:TfmSLoad;

procedure TputThread.startXfer (sender:Tobject);
begin
  with (myForm as TfmSLoad) do begin
    logText(myHost+' FTPP start',TfmSLoad(myForm).putTerminal);
  end;
end;

procedure TputThread.PacketTx(Sender: TObject; AWorkMode: TWorkMode;
       const AWorkCount: Integer);
var oMess:pDRM;
    percentVal:integer;
begin
  totalTx:=AWorkCount;
  if abortFlag then putFTP.abort
  else
    begin
      if (fSize=0) then exit;
      percentVal:=(aWorkCount*100) div fSize;
      updateGauge(TfmsLoad(myForm).gaPut,percentVal);
    end;
end;

procedure TputThread.xferStatus(Sender: TComponent; Status: String);
begin
  logText(myHost+' FTP put status
'+status,TfmSLoad(myForm).putTerminal);
end;

procedure TputThread.xferError(Sender:TComponent;Errno:Word;Errmsg:
string);
begin
  logText(myHost+' FTP put error '+intToStr(Errno)+' '+Errmsg,
    TfmSLoad(myForm).putTerminal);
end;

procedure TputThread.putComplete(Sender: TObject; AWorkMode:
TWorkMode);
var elapsedTime,rate,rate8:extended;
begin
  endTime:=DateTimeToTimeStamp(now);
  elapsedTime:=timeStampToMsecs(endTime)-timeStampToMsecs(startTime);
  rate:=totalTx/elapsedTime;
  rate8:=rate*8;
  logText(myHost+' FTPP stop, '+intToStr(totalTx)+
  ' bytes tx in '+floatToStr(elapsedTime/1000)+' s'+
  ' ( '+floatToStrF(rate,ffFixed,8,2)+'
'+floatToStrF(rate8,ffFixed,8,2)+' kB/bit/s)',
  TfmSLoad(myForm).putTerminal);
end;

procedure TputThread.Execute;
var pf:file of byte;
    winRemote,winDir:string;
    waitRemaining:integer;
begin
  freeOnTerminate:=true;
  if (0<>pos('/',remoteName)) then
  begin // it's a UNIX path
    winRemote:=stringReplace(remoteName,'/','\',[rfReplaceAll]);
    winDir:=ExtractFileDir(winRemote);
    fileName:=ExtractFileName(winRemote);
    filePath:=stringReplace(winDir,'\','/',[rfReplaceAll]);
  end
  else // it's a Windoze path
  begin
    fileName:=ExtractFileName(remoteName);
    filePath:=ExtractFileDir(remoteName);
  end;
  try
    assign(pf,localName);
    try
      reset(pf);
      fSize:=fileSize(pf);
    finally
      close(pf);
    end;
  except
    on e:exception do
    begin logText(e.message,
      TfmSLoad(myForm).putTerminal);
      exit;
    end;
  end;
  try
    repeat
    begin
      putFTP:=TidFTP.Create(nil);
      with putFTP do
      begin
        OnConnected:=startXfer;
        OnWork:=PacketTx;
        OnWorkEnd:=putComplete;
        Host:=TfmSLoad(myFOrm).ebIPaddr.text;
        Username:=myUserId;
        readtimeout:=Ptimeout;
        Password:=myPassword;
      end;
      try
        putFTP.connect;
        updateGauge(TfmsLoad(myForm).gaPut,0);
        if (filePath<>'') then putFTP.ChangeDir(filePath);
        if (fileName='') then fileName:=ExtractFileName(localName);
        startTime:=DateTimeToTimeStamp(now);
        putFTP.put(localName,fileName);
        putFTP.Disconnect;
        putFTP.free;
        if abortFlag then break;
      except
        on e:exception do
logText(e.Message,TfmSLoad(myForm).putTerminal);
      end;
    waitRemaining:=disconnectWait;
    repeat
      waitRemaining:=waitRemaining-100;
      if ((waitRemaining<0) or terminated) then break;
      sleep(100);
    until false;
    end until terminated;
  finally
  end;
end;

end.

Re:how do you abort a file transfer properly using NMFTP fastnet component


Thanx for the code, I had figured out the threads on my own but was nice to
see the sample code when I came back to double check this newsgroup.

I still have the orriginal problem, but now with a new component, so
obviously its something i'm overlooking.

Here is a summary of what my program does.

I zip up a file and use the ftp component to send it, if I cancel the
operation I can click another button and send it again
the problem that happens is that the zip component gives an error message
that the file cannot be created. I thought at first, maybe its the zip
component, so I did a test.

I ran my program but inserted code that changed the file that is uploaded,
so that it wasn't touching the file that I zipped up, and I would not get
the error, so that eliminated the zip component.

When I go into my explorer and try to delete the zip file it says "access
denied, program is in use by another program"

What I am obviously doing wrong is not releasing control on the file after I
abort the FTP.

I'm not sure how to release that file so that I can manipulating it.  Of
course closing my program will release it.

Quote
"Martin James" <mjames_fal...@dial.pipex.com> wrote in message

news:3dfa6162@newsgroups.borland.com...
Quote

> Galdran <gald...@hotmail.com> wrote in message
> news:3dfa39e8$1@newsgroups.borland.com...
> > Okay, i'll have to figure out how to do threads.

> Well, if it's any help, here's an FTP put thread using Indy.
> Obviously, it won't compile becasue it's part of a complete project &
> loadsa stuff unresolved but it maybee gives a basic idea.  This unit
> was written to contiunually put the same file onto a remote server,
> over & over again, with the intention of loading the network uplink.
> Because of the threading, I had no problem running lots of FTPputs,
> FTPgets, HTTPgets and pings, all at once.

> Rgds,
> Martin

> *************************************************

> unit FTPputThread;

> interface

> uses
>   Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms,
> Dialogs,
>    serConst, ExtCtrls, StdCtrls, Grids, Buttons, OleCtrls, SHDocVw,
> Gauges,
>   ComCtrls, AfViewers, NMecho, mailbox,
>   IdBaseComponent, IdComponent,IdTCPConnection, IdTCPClient, IdFTP;

> type

>   TputThread = class(TThread)
>   private
>     { Private declarations }
>   public
>     abortFlag:boolean;
>     myForm:Tcomponent;
>     fileName:string;
>     filePath:string;
>     remoteName:string;
>     localName:string;
>     fSize:integer;
>     totalTx:integer;
>     myHost:string;
>     myUserID:string;
>     myPassword:string;
>     disconnectWait:integer;
>     PTimeOut:integer;
>     putFTP:TidFTP;
>     startTime:TTimeStamp;
>     endTime:TTimeStamp;
>     procedure startXfer (sender:Tobject);
>     procedure PacketTx(Sender: TObject; AWorkMode: TWorkMode;
>        const AWorkCount: Integer);
>     procedure xferStatus(Sender: TComponent; Status: String);
>     procedure xferError (Sender:TComponent;Errno:Word;Errmsg:string);
>     procedure putComplete(Sender: TObject; AWorkMode: TWorkMode);
>     procedure Execute; override;
>   end;

> implementation

> uses loadForm;

> var rMyForm:TfmSLoad;

> procedure TputThread.startXfer (sender:Tobject);
> begin
>   with (myForm as TfmSLoad) do begin
>     logText(myHost+' FTPP start',TfmSLoad(myForm).putTerminal);
>   end;
> end;

> procedure TputThread.PacketTx(Sender: TObject; AWorkMode: TWorkMode;
>        const AWorkCount: Integer);
> var oMess:pDRM;
>     percentVal:integer;
> begin
>   totalTx:=AWorkCount;
>   if abortFlag then putFTP.abort
>   else
>     begin
>       if (fSize=0) then exit;
>       percentVal:=(aWorkCount*100) div fSize;
>       updateGauge(TfmsLoad(myForm).gaPut,percentVal);
>     end;
> end;

> procedure TputThread.xferStatus(Sender: TComponent; Status: String);
> begin
>   logText(myHost+' FTP put status
> '+status,TfmSLoad(myForm).putTerminal);
> end;

> procedure TputThread.xferError(Sender:TComponent;Errno:Word;Errmsg:
> string);
> begin
>   logText(myHost+' FTP put error '+intToStr(Errno)+' '+Errmsg,
>     TfmSLoad(myForm).putTerminal);
> end;

> procedure TputThread.putComplete(Sender: TObject; AWorkMode:
> TWorkMode);
> var elapsedTime,rate,rate8:extended;
> begin
>   endTime:=DateTimeToTimeStamp(now);
>   elapsedTime:=timeStampToMsecs(endTime)-timeStampToMsecs(startTime);
>   rate:=totalTx/elapsedTime;
>   rate8:=rate*8;
>   logText(myHost+' FTPP stop, '+intToStr(totalTx)+
>   ' bytes tx in '+floatToStr(elapsedTime/1000)+' s'+
>   ' ( '+floatToStrF(rate,ffFixed,8,2)+'
> '+floatToStrF(rate8,ffFixed,8,2)+' kB/bit/s)',
>   TfmSLoad(myForm).putTerminal);
> end;

> procedure TputThread.Execute;
> var pf:file of byte;
>     winRemote,winDir:string;
>     waitRemaining:integer;
> begin
>   freeOnTerminate:=true;
>   if (0<>pos('/',remoteName)) then
>   begin // it's a UNIX path
>     winRemote:=stringReplace(remoteName,'/','\',[rfReplaceAll]);
>     winDir:=ExtractFileDir(winRemote);
>     fileName:=ExtractFileName(winRemote);
>     filePath:=stringReplace(winDir,'\','/',[rfReplaceAll]);
>   end
>   else // it's a Windoze path
>   begin
>     fileName:=ExtractFileName(remoteName);
>     filePath:=ExtractFileDir(remoteName);
>   end;
>   try
>     assign(pf,localName);
>     try
>       reset(pf);
>       fSize:=fileSize(pf);
>     finally
>       close(pf);
>     end;
>   except
>     on e:exception do
>     begin logText(e.message,
>       TfmSLoad(myForm).putTerminal);
>       exit;
>     end;
>   end;
>   try
>     repeat
>     begin
>       putFTP:=TidFTP.Create(nil);
>       with putFTP do
>       begin
>         OnConnected:=startXfer;
>         OnWork:=PacketTx;
>         OnWorkEnd:=putComplete;
>         Host:=TfmSLoad(myFOrm).ebIPaddr.text;
>         Username:=myUserId;
>         readtimeout:=Ptimeout;
>         Password:=myPassword;
>       end;
>       try
>         putFTP.connect;
>         updateGauge(TfmsLoad(myForm).gaPut,0);
>         if (filePath<>'') then putFTP.ChangeDir(filePath);
>         if (fileName='') then fileName:=ExtractFileName(localName);
>         startTime:=DateTimeToTimeStamp(now);
>         putFTP.put(localName,fileName);
>         putFTP.Disconnect;
>         putFTP.free;
>         if abortFlag then break;
>       except
>         on e:exception do
> logText(e.Message,TfmSLoad(myForm).putTerminal);
>       end;
>     waitRemaining:=disconnectWait;
>     repeat
>       waitRemaining:=waitRemaining-100;
>       if ((waitRemaining<0) or terminated) then break;
>       sleep(100);
>     until false;
>     end until terminated;
>   finally
>   end;
> end;

> end.

Re:how do you abort a file transfer properly using NMFTP fastnet component


Better clarify this, cause rereading it it might sound like it is the
zipcomponent based on my test.

In my test, the only thing that changed is that the ftp component never
touches the zipfile. When I retry, the zip file is there, and it does
overwrite it and goes onto the next step again which is to upload the file
again.

Quote
"Galdran" <gald...@hotmail.com> wrote in message

news:3dfa6d6b@newsgroups.borland.com...
Quote
> Thanx for the code, I had figured out the threads on my own but was nice
to
> see the sample code when I came back to double check this newsgroup.

> I still have the orriginal problem, but now with a new component, so
> obviously its something i'm overlooking.

> Here is a summary of what my program does.

> I zip up a file and use the ftp component to send it, if I cancel the
> operation I can click another button and send it again
> the problem that happens is that the zip component gives an error message
> that the file cannot be created. I thought at first, maybe its the zip
> component, so I did a test.

> I ran my program but inserted code that changed the file that is uploaded,
> so that it wasn't touching the file that I zipped up, and I would not get
> the error, so that eliminated the zip component.

> When I go into my explorer and try to delete the zip file it says "access
> denied, program is in use by another program"

> What I am obviously doing wrong is not releasing control on the file after
I
> abort the FTP.

> I'm not sure how to release that file so that I can manipulating it.  Of
> course closing my program will release it.

> "Martin James" <mjames_fal...@dial.pipex.com> wrote in message
> news:3dfa6162@newsgroups.borland.com...

> > Galdran <gald...@hotmail.com> wrote in message
> > news:3dfa39e8$1@newsgroups.borland.com...
> > > Okay, i'll have to figure out how to do threads.

> > Well, if it's any help, here's an FTP put thread using Indy.
> > Obviously, it won't compile becasue it's part of a complete project &
> > loadsa stuff unresolved but it maybee gives a basic idea.  This unit
> > was written to contiunually put the same file onto a remote server,
> > over & over again, with the intention of loading the network uplink.
> > Because of the threading, I had no problem running lots of FTPputs,
> > FTPgets, HTTPgets and pings, all at once.

> > Rgds,
> > Martin

> > *************************************************

> > unit FTPputThread;

> > interface

> > uses
> >   Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms,
> > Dialogs,
> >    serConst, ExtCtrls, StdCtrls, Grids, Buttons, OleCtrls, SHDocVw,
> > Gauges,
> >   ComCtrls, AfViewers, NMecho, mailbox,
> >   IdBaseComponent, IdComponent,IdTCPConnection, IdTCPClient, IdFTP;

> > type

> >   TputThread = class(TThread)
> >   private
> >     { Private declarations }
> >   public
> >     abortFlag:boolean;
> >     myForm:Tcomponent;
> >     fileName:string;
> >     filePath:string;
> >     remoteName:string;
> >     localName:string;
> >     fSize:integer;
> >     totalTx:integer;
> >     myHost:string;
> >     myUserID:string;
> >     myPassword:string;
> >     disconnectWait:integer;
> >     PTimeOut:integer;
> >     putFTP:TidFTP;
> >     startTime:TTimeStamp;
> >     endTime:TTimeStamp;
> >     procedure startXfer (sender:Tobject);
> >     procedure PacketTx(Sender: TObject; AWorkMode: TWorkMode;
> >        const AWorkCount: Integer);
> >     procedure xferStatus(Sender: TComponent; Status: String);
> >     procedure xferError (Sender:TComponent;Errno:Word;Errmsg:string);
> >     procedure putComplete(Sender: TObject; AWorkMode: TWorkMode);
> >     procedure Execute; override;
> >   end;

> > implementation

> > uses loadForm;

> > var rMyForm:TfmSLoad;

> > procedure TputThread.startXfer (sender:Tobject);
> > begin
> >   with (myForm as TfmSLoad) do begin
> >     logText(myHost+' FTPP start',TfmSLoad(myForm).putTerminal);
> >   end;
> > end;

> > procedure TputThread.PacketTx(Sender: TObject; AWorkMode: TWorkMode;
> >        const AWorkCount: Integer);
> > var oMess:pDRM;
> >     percentVal:integer;
> > begin
> >   totalTx:=AWorkCount;
> >   if abortFlag then putFTP.abort
> >   else
> >     begin
> >       if (fSize=0) then exit;
> >       percentVal:=(aWorkCount*100) div fSize;
> >       updateGauge(TfmsLoad(myForm).gaPut,percentVal);
> >     end;
> > end;

> > procedure TputThread.xferStatus(Sender: TComponent; Status: String);
> > begin
> >   logText(myHost+' FTP put status
> > '+status,TfmSLoad(myForm).putTerminal);
> > end;

> > procedure TputThread.xferError(Sender:TComponent;Errno:Word;Errmsg:
> > string);
> > begin
> >   logText(myHost+' FTP put error '+intToStr(Errno)+' '+Errmsg,
> >     TfmSLoad(myForm).putTerminal);
> > end;

> > procedure TputThread.putComplete(Sender: TObject; AWorkMode:
> > TWorkMode);
> > var elapsedTime,rate,rate8:extended;
> > begin
> >   endTime:=DateTimeToTimeStamp(now);
> >   elapsedTime:=timeStampToMsecs(endTime)-timeStampToMsecs(startTime);
> >   rate:=totalTx/elapsedTime;
> >   rate8:=rate*8;
> >   logText(myHost+' FTPP stop, '+intToStr(totalTx)+
> >   ' bytes tx in '+floatToStr(elapsedTime/1000)+' s'+
> >   ' ( '+floatToStrF(rate,ffFixed,8,2)+'
> > '+floatToStrF(rate8,ffFixed,8,2)+' kB/bit/s)',
> >   TfmSLoad(myForm).putTerminal);
> > end;

> > procedure TputThread.Execute;
> > var pf:file of byte;
> >     winRemote,winDir:string;
> >     waitRemaining:integer;
> > begin
> >   freeOnTerminate:=true;
> >   if (0<>pos('/',remoteName)) then
> >   begin // it's a UNIX path
> >     winRemote:=stringReplace(remoteName,'/','\',[rfReplaceAll]);
> >     winDir:=ExtractFileDir(winRemote);
> >     fileName:=ExtractFileName(winRemote);
> >     filePath:=stringReplace(winDir,'\','/',[rfReplaceAll]);
> >   end
> >   else // it's a Windoze path
> >   begin
> >     fileName:=ExtractFileName(remoteName);
> >     filePath:=ExtractFileDir(remoteName);
> >   end;
> >   try
> >     assign(pf,localName);
> >     try
> >       reset(pf);
> >       fSize:=fileSize(pf);
> >     finally
> >       close(pf);
> >     end;
> >   except
> >     on e:exception do
> >     begin logText(e.message,
> >       TfmSLoad(myForm).putTerminal);
> >       exit;
> >     end;
> >   end;
> >   try
> >     repeat
> >     begin
> >       putFTP:=TidFTP.Create(nil);
> >       with putFTP do
> >       begin
> >         OnConnected:=startXfer;
> >         OnWork:=PacketTx;
> >         OnWorkEnd:=putComplete;
> >         Host:=TfmSLoad(myFOrm).ebIPaddr.text;
> >         Username:=myUserId;
> >         readtimeout:=Ptimeout;
> >         Password:=myPassword;
> >       end;
> >       try
> >         putFTP.connect;
> >         updateGauge(TfmsLoad(myForm).gaPut,0);
> >         if (filePath<>'') then putFTP.ChangeDir(filePath);
> >         if (fileName='') then fileName:=ExtractFileName(localName);
> >         startTime:=DateTimeToTimeStamp(now);
> >         putFTP.put(localName,fileName);
> >         putFTP.Disconnect;
> >         putFTP.free;
> >         if abortFlag then break;
> >       except
> >         on e:exception do
> > logText(e.Message,TfmSLoad(myForm).putTerminal);
> >       end;
> >     waitRemaining:=disconnectWait;
> >     repeat
> >       waitRemaining:=waitRemaining-100;
> >       if ((waitRemaining<0) or terminated) then break;
> >       sleep(100);
> >     until false;
> >     end until terminated;
> >   finally
> >   end;
> > end;

> > end.

Re:how do you abort a file transfer properly using NMFTP fastnet component


Quote
Galdran <gald...@hotmail.com> wrote in message

news:3dfa725a@newsgroups.borland.com...

Quote
> Better clarify this, cause rereading it it might sound like it is
the
> zipcomponent based on my test.

> In my test, the only thing that changed is that the ftp component
never
> touches the zipfile. When I retry, the zip file is there, and it
does
> overwrite it and goes onto the next step again which is to upload
the file
> again.

Hmm.. this is interesting.  I've just looked again at my old code.
It appears that I don't use the 'abort' method, but instead check an
'abort' boolean in the onWork event.  I wonder why I did this?   It's
so long ago, I've forgotten.  Perhaps 'abort' does not close the
file!

Rgds,
Martin

Other Threads