Skip to content

Instantly share code, notes, and snippets.

@jvanhoesen
Created March 28, 2022 18:36
Show Gist options
  • Save jvanhoesen/aea403982933d60be75570a6e9338c9c to your computer and use it in GitHub Desktop.
Save jvanhoesen/aea403982933d60be75570a6e9338c9c to your computer and use it in GitHub Desktop.
Open existing .Zip file
//Retrieving .ZIP file attached to Acumatica document
PX.SM.FileInfo fileInfo = uploadFileMaint.GetFile(zipFile);
if(fileInfo != null)
{
//Create a new memory stream from .ZIP file data
using (MemoryStream stream = new MemoryStream(fileInfo.BinData))
{
//Create new instance of ZipArchive to interact with .ZIP file
using (ZipArchive zip = ZipArchive.CreateFrom(stream, true))
{
//Code to read and process contents of .ZIP
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment