i try to upload an image to my ftp-server using ftplib with the following code -
import ftplib
import os
import sys
ADDR = "68.66.248.00"
USERNAME = "MyUser"
PW = "MyPw"
path = os.path.abspath(os.path.dirname(sys.argv[0]))
fn = os.path.join(path, "test.png")
session = ftplib.FTP()
session.connect(ADDR)
session.login(USERNAME, PW)
session.cwd("tmp/")
session.dir()
file = open(fn,'rb')
print("A")
session.storbinary('testXYZ.png', file)
print("B")
file.close()
session.quit()
When i run this code i get this output:
$ python testFTP.py
drwxr-xr-x 7 rapidtec rapidtec 4096 Sep 20 00:16 .
drwx--x--x 37 rapidtec rapidtec 4096 Dec 20 09:49 ..
drwx------ 2 rapidtec rapidtec 4096 Oct 12 2020 analog
drwx------ 2 rapidtec rapidtec 4096 Oct 12 2020 awstats
drwx------ 2 rapidtec rapidtec 4096 Oct 12 2020 webalizer
A
As you can see the program stopps working at the line with "session.storbinary". When i run this in vscode even the terminal is not anymore interruptable using Ctrl-C...
Why is the upload to the ftp-server not working and without any error?
It seems that the session-creation, and the session.cwd works fine but the file-transfer is for whatever reason not working
Why is this ftp-upload not working?