Solved

Delphi FTP component

Posted on 2000-04-07
9
1,741 Views
Last Modified: 2012-06-27
Does anyone know where I can find documentation on Delphi's FTP control?
I need to connect via FTP, navigate and put files (standard FTP stuff I guess!) but Delphi Help doesn't say much about it at all.

Cheers
0
Comment
Question by:sparkido
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
9 Comments
 
LVL 4

Expert Comment

by:jeurk
ID: 2692774
I suggest you use the components found on http://www.pbe.com/winshoes/ they are the best you can find.
the components are free and open source and very easy to use.
They is a sample that show how to do ftp stuff...
Let me know if I can help more on that ...
0
 

Expert Comment

by:sarc
ID: 2692781
Wich version of Delphi are you using? At D5 the "TNMFTP" has a really good help. (By the way - as as an alternative I suggest Francois Piette's ISC - it has a nice FTP-Component - and is free with sourcecode - that often helps...) Here are some of the basic functions you will need (if you are using the TNMFTP-Component):

constructor Create(AOwner: TComponent);
property UserID: string;
property Password: string;
property Host: String;  // name/ip of host to connect
property Port: Integer; // port you want to use
procedure Connect; // Connect now

procedure ChangeDir(DirName: string);

property ParseList: boolean; // auf true setzen vorm Dir-einlesen
procedure List; // Veranlaßt das einlesen des aktuellen Directories

Wurde das Directory eingelesen, stehen die Ergebnisse in:
property FTPDirectoryList: TFTPDirectoryList;

Diese kann dann einfach ausgelesen werden (jedes der Elemente ist eine vollwertige Stringliste - die Anzahl der Elemente bekommt man also z.B. über : FTPDirectoryList.name.count)

FTPDirectoryList.name[i];
FTPDirectoryList.modifdate[i];
FTPDirectoryList.attribute[i];
FTPDirectoryList.Size[i];


procedure Download(RemoteFile, LocalFile: string); // upload entsprechend

Hilfreich ist manchmal:
property CurrentDir: string;

Wenn ich hiermit nicht so richtig getroffen habe, dann schreib mir mal einfach genauer, was Du brauchst...

greetz
Carsten
0
 
LVL 2

Expert Comment

by:craig_capel
ID: 2692785
the standard ftp component with delphi is called "nmftp" just put it on your form, its very easy to use....

unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  StdCtrls, Psock, NMFtp;

type
  TForm1 = class(TForm)
    NMFTP1: TNMFTP;
    Button1: TButton;
    procedure Button1Click(Sender: TObject);
    procedure NMFTP1Connect(Sender: TObject);
    procedure NMFTP1ConnectionFailed(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.DFM}

procedure TForm1.Button1Click(Sender: TObject);
begin
  nmftp1.host:='ftp.xoom.com';
  nmftp1.password:='xxx';
  nmftp1.UserID:='whoever';
  nmftp1.connect;
    //The Events Now Say Whats Going On...
end;

procedure TForm1.NMFTP1Connect(Sender: TObject);
begin
   //Label1.caption:='Connected!';
     //Now Upload A File...
//  NMFTP1.Upload('c:\tosend\file.zip', 'file.zip');

end;

procedure TForm1.NMFTP1ConnectionFailed(Sender: TObject);
begin
//label1.caption:='Failed';
end;

end.
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Expert Comment

by:sarc
ID: 2692791
Hups... wrong language ;-)

Comments here in english again...
(TNMFTP is the FTP component delivered with D5)


constructor Create(AOwner: TComponent);
property UserID: string;
property Password: string;
property Host: String;  // name/ip of host to connect
property Port: Integer; // port you want to use
procedure Connect; // Connect now

procedure ChangeDir(DirName: string);

property ParseList: boolean; // set to true before reading a dir
procedure List; // read the actual dir

If you called "List" you find the results in:
property FTPDirectoryList: TFTPDirectoryList;

You can easyly access this list. each of its subelements is a StringList:

FTPDirectoryList.name[i];
FTPDirectoryList.modifdate[i];
FTPDirectoryList.attribute[i];
FTPDirectoryList.Size[i];


procedure Download(RemoteFile, LocalFile: string); // upload the same

Sometimes helpful:
property CurrentDir: string;

If you need more info - or it was another component you are using, tell me, I'll try to help if I can, but I need more info.

greetz
Carsten
0
 

Author Comment

by:sparkido
ID: 2692976
Sorry guys, should have been more specific. I am using the TFTP control you get with Delphi 3.
0
 
LVL 1

Accepted Solution

by:
mscatena earned 50 total points
ID: 2693067
Forget this Delphi 3 junk. It's a complete waste of time. If there were a contest for the worst component suite ever, the Internet components in Delphi 2.01/3 would have my vote. Its amazing that Borland had the nerve not only to put that garbage on Delphi 2.01 but still kept this piece of (four letter word) in Delphi 3.

The components in Delphi 4 and 5 are better (how could they NOT be?) but still barely usable.

Go get the free Winshoes (http://www.pbe.com/winshoes/) or the shareware ones at www.argosoft.com (better yet).

0
 

Expert Comment

by:sarc
ID: 2693247
Hi!

Same comment from me, too... The components in D3 are really a bit(????) horrible. If you still want I can try to explain them a bit, but I (too) recommend a freeware component - where I prefer ISC (Internet Component Suite) from F. Piette - available from nearly each Delphi Ressource Server (Delphi Superpage for example). It has an FTP Server and an FTP Client component and is quite easy to use (MUCH MUCH more easy than the D3-Components - and MUCH MUCH more stable).

greetz
Carsten
0
 
LVL 3

Expert Comment

by:bryan7
ID: 2694308
try FPiette's FREE components: www.rtfm.be/fpiette/indexuk.htm
it has an FTP component which is great, comes with full source and examples
0
 
LVL 4

Expert Comment

by:jeurk
ID: 2699623
hello sparkido,
Why is mscatena's answer accepted ?
just curious...
CU
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
This video Micro Tutorial shows how to password-protect PDF files with free software. Many software products can do this, such as Adobe Acrobat (but not Adobe Reader), Nuance PaperPort, and Nuance Power PDF, but they are not free products. This vide…
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question