I have a zip file which is present on an SFTP server. I am writing a AWS lambda function and have Paramiko module to connect to the SFTP server. I have written below code to unzip the file and code is getting executed successfully but the file is not getting unzipped. Can some one please help where I am going wrong or an alternate way to unzip the file on server?
to_sftp.chdir('<dir name>')
flo = BytesIO()
to_sftp.getfo('<dir name/filename.zip', flo)
flo.seek(0)
root = z.ZipFile(flo,'w')
print(root)
root.extractall(to_sftp.chdir('<dir name'))