Some FTP servers return full path from NLIST

Use `ftp_pwd` and `basename` to ensure the correct FTP path and file are retrieved.