I am using the below Python code to upload a file via SFTP using Paramiko. The connection "seems" to be fine, the code executes to the end, just the file isn't reaching the destination when I check in FileZilla.
I have checked and set permissions on the file to 777 (just to be sure). I have also checked my file path string in a separate terminal and the path is valid.
import paramiko
.
.
transport = paramiko.Transport((host, port))
transport.connect(username = username, password = password)
sftp = paramiko.SFTPClient.from_transport(transport)
sftp.put(filePath, "/") # Upload file to root FTP folder
sftp.close()
transport.close()
What can I do to debug this? Anything I can print out, check connection succeeded etc?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…