I have a method which will accept a list of byte arrays. My method needs to be able to create a .csv file for each of these arrays and then archive the files. I've mocked up something what I need to achieve in this small test method:
Directory.CreateDirectory("C:\\Users\\user\\Documents\\Temp\\Files\\TempDir");
File.Create("C:\\Users\\user\\Documents\\Temp\\Files\\TempDir\\Temp1.csv").Dispose();
File.Create("C:\\Users\\user\\Documents\\Temp\\Files\\TempDir\\Temp2.csv").Dispose();
File.Create("C:\\Users\\user\\Documents\\Temp\\Files\\TempDir\\Temp3.csv").Dispose();
ZipFile.CreateFromDirectory("C:\\Users\\user\\Documents\\Temp\\Files\\TempDir", "C:\\Users\\user\\Documents\\Temp\\Files\\ArchDir.zip");
The issue is that I'm writing to the disk with this method. The actual application this method will run on will be a service so I can't use filepaths for the method. Is it possible to create and archive files on the fly? The downloaded archive is going to be passed to a controller and returned to the client through a browser to give some context to this.