lNet FTP module not sending password lazarus / 5-Lazarus Extra Components ---------------------------------------------------------------------- mf_blues · 2008-06-26 08:41 First Off, Hi everyone I've just started using Lazarus so I'm a newbie round here. Problems already. I've installed the lNet package OK and I'm trying to connect to an FTP server using the FTP module, I'm probably doing something really daft cus I can't find any help on it but the server keeps showing that a password is required. I'm using the following bit of code. I named the component ftp1 for simplicity. ftp1.authenticate('uname','password'); ftp1.connect; When run the server shows I'm connecting, then shows the user name, then states a password is required for the user. Anyone know why it's not sending the password when it connects. Thanks Mart. ---------------------------------------------------------------------- Almindor · 2008-06-26 11:03 Connect first authenticate later. Specifically, you need to first "finish" connecting. So issue a FTP.Connect; then wait for the OnConnect event (or check .Connected if you don't want to use the event for some reason) and after that issue the auth etc. You can see how to use it in the examples (examples/visual/ftp or examples/console/lftp). Admittedly, I don't properly handle this kind of user error (there's no error reported, and indeed the internal status could get broken this way). So basically while you did use it wrongly you found me a "oversight bug" ---------------------------------------------------------------------- mf_blues · 2008-06-26 11:49 Thanks for your quick reply. I did try using both methods you suggest. If I don't put the authenticate first the FTP server doesn't see any user at all, when I do put the authenticate first the user is accepted but it displays on the server  'password required for user 'name' ', I've even tried authenticating before and after at the same time but it makes no difference. Sorry to be a pain. cheers Mart. ---------------------------------------------------------------------- Almindor · 2008-06-26 12:11 Isn't this per-chance some sort of Microsoft server? I had some problems with specific servers requireing both USER and PASS commands to be passed in unison. In any case always .Connect before any other command, and only issue commands after a successful connect. Can you give me the server's address? If it's private tho I can't help. ---------------------------------------------------------------------- mf_blues · 2008-06-26 13:13 Using Filezilla Server on a virtual PC for testing at this stage, I can do this ok in delphi using the indy components but lazarus connects to the database I want to use easier than delphi does but the ftp issue is the only thing holding me back. Eventually the program will extract invoice data from our financial software, create a csv file of only the required data then ftp the file to the customers ftp sight to be processed for payment. I can do this using delphi but it requires a couple of extra steps to get the data from the accounts software, with lazarus I can get the data direct and send it all in one go, just need to fix the FTP issue. cheers Mart ---------------------------------------------------------------------- Almindor · 2008-06-26 18:22 Ok, so you're using a "filezilla" server and it thinks it didn't get the password right? I'll try to set one up and see if I can reproduce. The password IS sent, I know because it works on all FTP servers I have access to (I guess none of them is "filezilla"), but there were some problems in the past in the way USER and PASSWORD commands got sent. ---------------------------------------------------------------------- Almindor · 2008-06-26 19:36 I tried setting up Filezilla server (in wine tho) and for me all worked ok. I set up a user with password requirement, and connected and authenticated properly. Can you please try with the example FTP programs provided in lNet? Try the commandline too please, I tested with that one. If those work there's something different in your code, or you just did a mistake (e.g: bad password or something). Also what version of the filezilla server do you run? I tested with latest from their page. ---------------------------------------------------------------------- Almindor · 2008-06-28 09:29 Can you please tell me how it ended? Even if you didn't try and went to some other library, I want to know, thanks.