Re: TIdFTP.Get to overwrite the file

Giganews Newsgroups
Subject: Re: TIdFTP.Get to overwrite the file
Posted by:  Don (kingfi…
Date: Mon, 30 Jan 2006

>I have used the TIdFTP to get a file from server.
> However. if  there is already a file in my local folder, it caused an
> exception.

> IdFTP1.Get(...., ...., TRUE, TRUE);

> As I set the CanOverwrite parameter to TRUE, why it caused an exception ?

First, unless you want restart a failed download, you need to use:

    Get(sSrc, sDest, True, False);

Use of the CanOvewrite and CanResume arguments are covered in the docs.

If the file us in use, or has read-only attributes, the Get operation will
fail with an exception.  What is the message in the exception?


In response to

TIdFTP.Get to overwrite the file posted by Man Utd on Tue, 31 Jan 2006