faqts : Computers : Programming : Languages : Delphi

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

38 of 50 people (76%) answered Yes
Recently 8 of 10 people (80%) answered Yes

Entry

Delphi: Internet: Ftp: Client: Create: How to create a simple FTP client?

Aug 24th, 2003 16:17
Knud van Eeden,


----------------------------------------------------------------------
--- Knud van Eeden --- 25 August 2003 - 01:08 am ---------------------

Delphi: Internet: Ftp: Client: Create: How to create a simple FTP 
client?

Delphi v7:

Steps: Overview:

 1. -Open a new application

 2. -Put a button on the form

 3. -Put an Indy ftp component on the form

     (palette 'Indy Client',

      component 'IdFTP')

 4. -Include

      IdFTPCommon

     in your 'uses' clause

 5. - Double click on the button and
      add source code similar to:

procedure TForm1.Button1Click(Sender: TObject);
begin
 IdFTP1.Host := '<your ftp site>'; // e.g. 'ftp.redhat.com'
 IdFTP1.Username := '<your username>'; // e.g. 'anonymous'
 IdFTP1.Password := '<your password>'; // e.g. youremailaddress
 // then use commands like:
 // IdFTP1.OpenWriteBuffer( -1 );
 // IdFTP1.TransferType := ftBinary;
 // IdFTP1.Get( 'index.html', 'c:\temp\index.html', true ); // 
 // here 'true' means overwrite existing file
 // IdFTP1.Abort; // forces the data connection to be closed.
 // IdFTP1.Quit;
end;

---

[Internet: see also: http://www.google.com search for 'IdFTP1.Get': 
http://www.nevrona.com/Indy/Bugs/Data/TIdFTPSlow.htm]

----------------------------------------------------------------------