I am struggling to upload file to my FTP server. Please advise what is wrong in code below:
host: someserver.com
path: ./my_folder/at_this_server
target: 'test.pdf'
with ftputil.FTPHost(ftp_settings['host'],
ftp_settings['user'],
ftp_settings['password'],
ftp_settings['port']) as ftp_host:
safe_chdir(ftp_host, ftp_settings['path']) # change FTP dir
ftp_host.upload_if_newer('local_test.pdf', 'test.pdf')
There is successfully execute the command upload_if_newer()
or upload()
, but I don't see any uploaded file to the FTP folder.
UPDATE
I found that file is uploading to host+"/my_folder"
only instead of host+"/my_folder/at_this_server"
.