


If you're not using the MVC Framework you cannot do that, but you can still handle the MemoryStream in a different way - by using Response.OutputStream or other standard techniques.įor further info regarding this topic you can also read this post on my blog. Extractor is an indispensable utility app that can be used to unarchive a range of files such as Zip, Rar, Tar, Gzip, 7z and more at lightning speed. Return File(ms.ToArray(), "application/zip", "Archive.zip") ĭepending on your scenario you can use it inside a MVC Controller returning an ActionResult, persist the MemoryStream to disk, replace it with a FileStream and so on: in the above example I used the Controller.File method (from namespace) to return a FileContentResult object. Download softwareName and enjoy it on your iPhone, iPad, and iPod touch. WinRAR is an app that can extract compressed files, as well as compress.
#Zip file download mac rar#
An ideal app for managing ZIP or RAR files. Using (var zipStream = zipArchiveEntry.Open()) zipStream.Write(file2, 0, file2.Length) Download the latest version of WinRAR for Mac. ZipArchiveEntry = archive.CreateEntry("file2.txt", CompressionLevel.Fastest) Using (var zipStream = zipArchiveEntry.Open()) zipStream.Write(file1, 0, file1.Length) Var zipArchiveEntry = archive.CreateEntry("file1.txt", CompressionLevel.Fastest)
#Zip file download mac archive#
Using (var archive = new ZipArchive(ms, ZipArchiveMode.Create, true)) Using (MemoryStream ms = new MemoryStream()) Here’s a quick implementation sample using a MemoryStream and a couple of byte arrays representing two files: byte file1 = GetFile1ByteArray()
#Zip file download mac mac os#
NET Framework 4.5 or newer you can do this using the highly-efficient ASP.NET native System.IO.Compression.ZipArchive class, which should be fully compatible with any zip implementation you can find (Windows OS, MAC OS and so on). I'm using Path.Combine to get the folder's path, could be because of that? string SourceFolderPath = System.IO.Path.Combine(FolderPath, "Initial") When using a Mac, inside of the resultant ZIP the folders disappear, and the files which should be in folders are called like images\picture1.png Response.AddHeader("Content-Length", ()) If (File.Exists(SourceZip)) ", file.Name)) String SourceZip = System.IO.Path.Combine(UserTemp, nameFolder + ".zip") I'm using the following code to download a set of files and folders as a ZIP, which works great in a Windows, but not in a Mac string SourceFolderPath = System.IO.Path.Combine(FolderPath, "Initial")
