Reputation: 123
I'm using Azure with blob storage ans Azure Functions. I got a lot of files and sometimes I want to generate a zip, save it in the storage and generate a link.
As my zip can be big (1 or 2 Go) I would like to do this "on the fly", meaning without using all the memory before save it:
stream on a zipentry
write to the blob
flush the stream
create next zipentry
I know I must use the method PutBlock() in the container, but I'm missing the code between ICSharpZipLib and BlobContainer.
Has someone an idea about it ?
Upvotes: 3
Views: 2087
Reputation: 123
Well, if I look more attentively at the documentation, I would have seen the method
blob.OpenWrite()
which returns a stream :
using (ZipOutputStream zipStream = new ZipOutputStream(blob.OpenWrite()))
Then I did as usual.
Upvotes: 4