Link to home
Start Free TrialLog in
Avatar of Oppital
OppitalFlag for Brazil

asked on

Sftp Connection in Delphi

Avatar of systan
systan
Flag of Philippines image

How about indy ftp component?

with IdFTP1 do begin

  Host := Edit1.Text; // host
  User := Edit2.Text; // username
  Password := Edit3.Text; // password
  Connect; // make a connection
  TransferType := ftBinary; // or ftASCII
  // Upload a file
  Put(UploadOpenDialog1.FileName, ExtractFileName(UploadOpenDialog1.FileName));

  // or

 //Download a file
 // Get(Name, SaveDialog1.FileName, true);

  Quit; // close the connection

end;
If you want to connect anonymously;

IdFTP1.ProxySettings.ProxyType := fpcmNone;
IdFTP1.User := 'anonymous';
IdFTP1.Password := 'test@test.com';
IdFTP1.Connect(true, 500);
Avatar of Oppital

ASKER

@maosalah

Thanks for the example but I'm looking for a free solution, unpaid
Avatar of Oppital

ASKER

@systan

This is an example of common FTP connection, I'm looking for SFTP

thanks
Correct me if I'm wrong;

The only diference between ftp and sftp is there encryptions

If you want to create your own sftp connections, you should create sftp server and client

For sftp client;  encypt your user and password before sending it.
For sftp server;   user and password recieved shall be decrypted before comparing to the users database.

A sample code would be nice, but its time consuming because we have to start from the scratch.

If you have started doing it, you can submit your codea here, and let us discuss some changes of the code.

Lets share ideas by code snippet.
Avatar of Oppital

ASKER

I believe there are more differences

because the companies charge expensive encryption tools, must have something more, would be very simple to encrypt and send
ASKER CERTIFIED SOLUTION
Avatar of systan
systan
Flag of Philippines image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Comments are good, please;
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Oppital

ASKER

@systan thanks for the tip, is helping a lot

@NevTon thank you for explaining ssl

could please send me a practical example
>>You have to add IdServerIOHandlerSSLOpenSSL
Yes, I'm not done with that part, but you have it.

>>could please send me a practical example
Oh men, your just like me, always want a sample, lol, tired of thinking... ?
Anyway, if I have time to program basically of what you want, I will.


@Nevton, thanks for the good approach.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
What version of delphi you have?
Avatar of Oppital

ASKER

I am extremely pleased with the help of you two, thanks, I'm a fan of you now
Avatar of Oppital

ASKER

Perfect no more doubts
The demo of indy10 SFTP;
http://www.mediafire.com/?nzmteymmoin

Thanks