More on Delphi Examples - WeOnlyDo Discussion board

More on Delphi Examples (General questions)

by Bret, Monday, September 12, 2005, 16:42 (7011 days ago)

I'm Still having problems with PutFile command.

Guess I just don't get the RemotePath parameter.

below is what I am trying to do... Please give example code that will work.

FTP.RemotePath := '';
FTP.PutFile('c:cmw.log','.');

//SO FAR SO GOOD....

FTP.RemotePath := 'outgoing';
FTP.PutFile('c:copytojst.bat','.');

//The above Put method fails. Please give a working example that should work putting the file into the outgoing directory.
//I've tried multiple combinations... no success.


Re: More on Delphi Examples

by Bret, Monday, September 12, 2005, 16:44 (7011 days ago) @ Bret

This forum software is stripping backslashes.... assume I put proper backslashes in my above example.

Re: More on Delphi Examples

by wodSupport, Monday, September 12, 2005, 16:47 (7011 days ago) @ Bret

Bret,

you should always use full path, even for RemotePath, so setting '.' is not good.

You should use something like

/home/joe/somefile

In order to retrieve home path, you can use RealPath method. RealPath( . ) or RealPath( ~ ) methods have special meaning on UNIX and will probably give you path you need. Then just append filename - and that's it.

Hope it helps.