title: How to download FTP file using its full FTP path?
body: <p>Using the ftplib in Python, you can download files, but it seems you are restricted to use  the file name only (not the full file path). The following code successfully downloads the requested code:</p>
  
  <pre><code>import ftplib
  ftp=ftplib.FTP("ladsweb.nascom.nasa.gov")
  ftp.login()
  ftp.cwd("/allData/5/MOD11A1/2002/001")
  ftp.retrbinary('RETR MOD11A1.A2002001.h00v08.005.2007079015634.hdf',open("MOD11A1.A2002001.h00v08.005.2007079015634.hdf",'wb').write)
  </code></pre>
  
  <p>As you can see, first a login to the site (<code>ftp.login()</code>) is established and then the current directory is set (<code>ftp.cwd()</code>). After that you need to declare the file name to download the file that resides in the current directory.
  How about downloading the file directly by using its full path/link?</p>