Error shown when uploading to ftp server in python

Viewed 10

I'm having a issue with the ftplib module about uploading the file, I try to upload a file with the filename being encrypted, This happens:

code:

def upload_file():
file_obj = filedialog.askopenfilename()
print(os.path.exists(file_obj))
with open(file_obj, "rb") as fp:
    ftp.storbinary("STOR "+cryptocode.encrypt(os.path.basename(file_obj), password), fp)

Error:

ftplib.error_perm: 553 Can't open that file: No such file or directory

Can anyone explain?

0 Answers
Related