-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Closed
Labels
Milestone
Description
ZipArchive doesn't currently allow manipulation permissions within. I ran into this when creating file in memory, dropping it into a zip and handing off to another system. With this code deployed on Linux, I'm not seeing a way to give the receiving system read access to contents of zip.
Example:
using (var memoryStream = new MemoryStream())
{
using (var archive = new ZipArchive(memoryStream, ZipArchiveMode.Create, true))
{
var lambdaFile = archive.CreateEntry("index.js");
using (var entryStream = lambdaFile.Open())
using (var streamWriter = new StreamWriter(entryStream))
{
streamWriter.Write(functionContent);
}
}
memoryStream.Seek(0, SeekOrigin.Begin);
svcFile.UploadFile(bucketName, s3Key, memoryStream);
}