gaqmonitor.blogg.se

Create zip files classic asp
Create zip files classic asp








Long bufferSize = inputStream.Length < BUFFER_SIZE ? inputStream.Length : BUFFER_SIZE Private static void CopyStream(System.IO.FileStream inputStream, System.IO.Stream outputStream) Using (FileStream fileStream = new FileStream(fileToAdd, FileMode.Open, FileAccess.Read)) PackagePart part = zip.CreatePart(uri, "",CompressionOption.Normal) Uri uri = PackUriHelper.CreatePartUri(new Uri(destFilename, UriKind.Relative)) String destFilename = ".\\" + Path.GetFileName(fileToAdd) Using (Package zip = System.IO.(zipFilename, FileMode.OpenOrCreate)) Private static void AddFileToZip(string zipFilename, string fileToAdd) using System ĪddFileToZip("Output.zip", const long BUFFER_SIZE = 4096 The link isn't stable, so here's the example Jon provided in the post.

create zip files classic asp

Here's a blog post with an example (its at the end dig for it). System.IO.Packaging has classes that can be used to drop content into a zip file.

create zip files classic asp

You don't have to use an external library anymore.










Create zip files classic asp