From f6ced73b9fe14f90735342d08e979a19002200a8 Mon Sep 17 00:00:00 2001 From: Chase Tucker Date: Wed, 6 Sep 2023 12:10:15 -0700 Subject: [PATCH] Creates directories for zipped files if they do not exist --- Fab2ApprovalSystem/Misc/Zipper.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Fab2ApprovalSystem/Misc/Zipper.cs b/Fab2ApprovalSystem/Misc/Zipper.cs index 75321fd..99c5ad3 100644 --- a/Fab2ApprovalSystem/Misc/Zipper.cs +++ b/Fab2ApprovalSystem/Misc/Zipper.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; using System.Web; @@ -23,6 +23,7 @@ namespace Fab2ApprovalSystem.Misc /// public void CreateZip(string outPathname, string folderName) { // TODO Try and Catch block + Directory.CreateDirectory(Path.GetDirectoryName(outPathname)); FileStream fsOut = File.Create(outPathname); ZipOutputStream zipStream = new ZipOutputStream(fsOut); @@ -95,4 +96,4 @@ namespace Fab2ApprovalSystem.Misc } -} \ No newline at end of file +}