Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9013435
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T03:15:56+00:00 2026-06-16T03:15:56+00:00

What I like to do is instead of storing a zip file on disk,

  • 0

What I like to do is instead of storing a zip file on disk, I like to open it up from a MemoryStream.

I am looking at the documentation for DotNetZip programming example:
Note that I tweaked it slightly based on what I thought may be needed.

    var ms = new MemoryStream();
    using (ZipFile zip = new ZipFile())
    {
       zip.AddFile("ReadMe.txt");
       zip.AddFile("7440-N49th.png");
       zip.AddFile("2008_Annual_Report.pdf");        
       zip.Save(ms); // this will save the files in memory steam
    }


  // now what I need is for the zip file to open up so that 
     the user can view all the files in it. Not sure what to do next after 
     zip.Save(ms) for this to happen. 
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T03:15:58+00:00Added an answer on June 16, 2026 at 3:15 am

    Try this:

    public ActionResult Index()
    {
        var memoryStream = new MemoryStream();
    
        using (var zip = new ZipFile())
        {
            zip.AddFile("ReadMe.txt");
            zip.AddFile("7440-N49th.png");
            zip.AddFile("2008_Annual_Report.pdf"); 
            zip.Save(memoryStream);
        }
    
        memoryStream.Seek(0, 0);
        return File(memoryStream, "application/octet-stream", "archive.zip");
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

What I'm looking for is a method that works like captureScreenshot(String path), but instead
I'm looking for an existing view controller like ABPeoplePickerNavigationController that instead of showing contacts
From first glance, it would appear I have two basic choices for storing ZIP
I would like to assign a variable instead of the string in my following
When is it a good idea to use something like CRDT instead of paxos
Is there anything like Jsoup but instead of parsing HTML, I need to parse
Instead of using an interface like this: public interface IStartable { void Start(); void
I'd like to have an 'UnassignedDepartment' object instead of letting employees have a null
Like this question , except T-SQL instead of php. 206275947 = 2062759.47 etc. The
I would like to use Google Chrome instead of the WebKit Framework in one

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.