I saw an example how to upload a file to SFTP
import pysftp
srv = pysftp.Connection(host="www.destination.com", username="root",
password="password",log="./temp/pysftp.log")
with srv.cd('public'): #chdir to public
srv.put('C:\Users\XXX\Dropbox\test.txt') #upload file to nodejs/
# Closes the connection
srv.close()
But how can I upload and zip it at the same time? To be clear I don't want to zip it and then upload it, I want to make it at the same time using zipped stream.