I'm downloading a zip file from S3 in Go like so:
buff := &aws.WriteAtBuffer{}
downloader := s3manager.NewDownloader(session.New(config))
_, err := downloader.Download(buff, &input)
if err != nil {
log.Println(err)
return err
}
data := buff.Bytes()
I send 'data' to a client that's written in Python3, and need to convert this byte array back to a zip file and put it in a specified directory. I've tried this:
file_bytes = msg_obj["Params"]
try:
zf = zipfile.ZipFile(file_bytes, "r")
for fileinfo in zf.infolist():
print(zf.read(fileinfo).decode('ascii'))
except: print("Err:", sys.exc_info()[0])
But I get this error:
OSError: [Errno 36] File name too long"
I just want to 'rebuild' the zip file and save it to a directory.