Author Topic: Problem with ftp  (Read 6906 times)

chuck-wright

  • Newbie
  • *
  • Posts: 8
Problem with ftp
« on: January 09, 2012, 05:57:40 am »
Hi,

I am enjoying using my new P175, which is a very useful tool.

In the Fm Analyzer Tool application, I am attempting to use FTP to upload files to a Unix system. If I specify a 'Remote Dir' of 'outdir' (outdir exists), the files are NOT being written to the 'outdir' directory. Instead, they are being written to the directory above that, using a file name of, for example, 'outdir\myfile.jpg'. Perhaps the code is assuming that the FTP server is using Windows naming convention, and the Unix FTP server just includes the '\' as part of the file name?

Thanks,
Chuck Wright

Jan

  • Hero Member
  • *****
  • Posts: 1139
Re: Problem with ftp
« Reply #1 on: January 09, 2012, 09:56:16 am »
Currently the ftp upload is handled as follows (shortened):

Code: [Select]
if (Length(fp)>0) and (RightStr(fp,1)<>'\') and (RightStr(fp,1)<>'/') then fp:=fp+'\';
IdFTP1.Put(fw+fn, fp+fd, false);

where
fp is the text from Remote Dir box,
fd is the remote file name.

So the backslash '\' is added at the end of the Remote Dir by default.
I think you can simply solve it by adding '/' at the end of the Remote Dir.

chuck-wright

  • Newbie
  • *
  • Posts: 8
Re: Problem with ftp
« Reply #2 on: January 09, 2012, 04:44:14 pm »
Yes, that makes it work. Thanks!
- C