Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Delphi FTP component

Posted on 2000-04-07
9
Medium Priority
?
1,814 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
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 

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 200 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses

636 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