title: TIdFTP.GET, What is the correct way to refer to the file in the remote folder?
body: <p>I am trying to use TIdFTP.Get (version 10) to download a file (ssleay32.dll) from a remote server where I have an account.</p>
  
  <p>The file does exists in a folder on the server and I can use TIdFTP to connect OK. However no matter how I refer to path to the fileTIdFTP.Get keeps giving the error, Can't open : No such file or directory.</p>
  
  <p>If I try to change directory first into the directory where the file is and then just use the filename I get the same error when I try to change directory.</p>
  
  <p>What is the correct way to refer to the file so it downloads correctly?</p>
  
  <p>For info,When I log into the server using Filezilla and the same credentials as used by TIdFTP, Filezilla seems to show the path as /MAMbase. I have tried with /MAMbase, ../MAMbase, ./MAMbase, /MAMbase/ and other variations without success.</p>
  
  <p><a href="https://i.stack.imgur.com/jcU5a.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/jcU5a.png" alt="((ssleay32.dll)"></a></p>
  
  <p>The code I am using, after setting the connection paramers of host,post,username and password is below. Using either the path in the connect and get with just the filename or the get with the full path give the same error with any of the path formats I have used.</p>
  
  <pre><code>if (not fileexists(pathToCommonFiles + 'libeay32.dll'))  or (not fileexists(pathToCommonFiles + 'ssleay32.dll')) then
       begin
       try
         try
         IdFTP1.Connect ;
    //   IdFTP1.ChangeDir('MAMbase/');
    //   IdFTP1.Get('ssleay32.dll', pathToCommonFiles + 'libeay32.dll',true); 
         IdFTP1.Get('./MAMbase/ssleay32.dll',pathToCommonFiles + 'ssleay32.dll',true); 
         except on E: Exception do
              showmessage ( 'Could not make ftp connection for SSL files'  +slinebreak +
                            'Exception class name = '+E.ClassName+ slinebreak
                         +  'Exception message = '+E.Message);
         end;
       finally
          IdFTP1.quit ;
       end;
  
       end;
  </code></pre>
  
  <p>I have looked at similar questions <a href="https://stackoverflow.com/questions/27063187/downloading-list-of-files-from-remote-ftp">here</a> and <a href="https://github.com/mscdex/node-ftp/issues/45" rel="nofollow noreferrer">here</a> but am no further forward. </p>
  
  <p>(BTW pathToCommonFiles contains a trailing slash and it exists)</p>