Recent

Author Topic: posibility to ftp  (Read 13385 times)

JanH

  • Guest
posibility to ftp
« on: June 18, 2007, 12:12:21 pm »
Hi there,

I just want to know: is there any ftp component for lazarus? I want to write a litte client program, which send/receive file to local folder.

ciao

theo

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1947
RE: posibility to ftp
« Reply #1 on: June 18, 2007, 12:36:51 pm »

JanH

  • Guest
RE: posibility to ftp
« Reply #2 on: June 18, 2007, 01:15:23 pm »
ah, thanks. I will try it

Almindor

  • Sr. Member
  • ****
  • Posts: 412
    • http://www.astarot.tk
RE: posibility to ftp
« Reply #3 on: June 19, 2007, 06:45:26 pm »
You can use LNet which has a fully working Lazarus-integrated FTP component and a working example client (which does most of the standard stuff). But only client-side for now, no FTP server. You can get it here http://wiki.lazarus.freepascal.org/lNet

JanH

  • Guest
RE: posibility to ftp
« Reply #4 on: June 21, 2007, 09:26:37 am »
synapse componet works fine.

then I tried to use lNet conponent, but it seems that it only workwith passive mode of ftp. is that right? although I set the property TransferMethod to ftActive.

Almindor

  • Sr. Member
  • ****
  • Posts: 412
    • http://www.astarot.tk
RE: posibility to ftp
« Reply #5 on: June 23, 2007, 12:12:21 pm »
You're right, there's atleast 2 bugs regarding active mode.

1st problem is that visually changing TransferMethod in OI doesn't change it for me ( I get ftPassive inside code ). This was a bug in my code (I didn't use "default" properly)

2nd problem is that PORT was broken because of wrong GetLocalAddress (I used HostAddrToString instead of NetAddrToString).

There was also a hidden problem with TCP server socket iterator but unrelated.

Thanks for mentioning/testing. 0.5.3 will have it all fixed :D

JanH

  • Guest
RE: posibility to ftp
« Reply #6 on: June 26, 2007, 03:19:56 pm »
hi almindor2,

thanx for the version 0.5.3. I have tested it again with ftActive...
My results are:
Quote

220 FTP Server ready.

331 Password required for *****.

230 User ***** logged in.

Error on bind[10048]: Normalerweise darf jede Socketadresse (Protokoll, Netzwerkadresse oder Anschluss) nur jeweils einmal verwendet werden.
200 Type set to I

200 PORT command successful

425 Unable to build data connection: Connection refused


Can you tell my what's going wrong?

greets

windy

  • Full Member
  • ***
  • Posts: 186
RE: posibility to ftp
« Reply #7 on: October 22, 2007, 05:00:25 am »
Hi
sorry to bring up an old thread
I was trying to get synapse to work to send FTP files to a server (login and username needed)
on a mac with lazarus
and trying out the simplesftp
but there problems in getting it to compile
looking for guidence!
or alternatives to use ftp ftp for lazarus on a mac? (intel)?
thanks!

theo

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1947
RE: posibility to ftp
« Reply #8 on: October 22, 2007, 10:44:11 am »
SimpleSFTP implements a Secure File Transfer Protocol Client. probably not what you need.
Generally, the Demos often have "winsock" in the uses clause, replace with "synsock".
The most simple way to use FTP are the built-in-functions like:
function FtpPutFile(const IP, Port, FileName, LocalFile, User, Pass: string): Boolean;
See: http://synapse.ararat.cz/docs/help/ftpsend.html
I don't know how well it works on a mac.

windy

  • Full Member
  • ***
  • Posts: 186
RE: posibility to ftp
« Reply #9 on: October 22, 2007, 08:06:34 pm »
ah,ok, i had tried that put file, but I did not have the username and password passed as well
Sucess!!!
thanks very much!!!!

windy

  • Full Member
  • ***
  • Posts: 186
RE: posibility to ftp
« Reply #10 on: October 27, 2007, 11:54:13 pm »
Hi
just wondering if the Tftpsend routine can be set to be non blocking?
(i.e so control is passed back to the program)?
thanks!
Brian

 

TinyPortal © 2005-2018