title: How to store a pdf within a zip file, without saving it locally
body: <p>I have a zip file within a zip file and inside the inner zip file I have an Excel and a PDF/Tif document.</p>
  
  <p>I'm currently developing a tool that reads all these files and store them in the database. Before I used to store both files on a folder first, but since the zip files holds loads of files I received an out of disk space exception. </p>
  
  <p>So now I want to try to store the files in the database directly without knowing the folder location.</p>
  
  <pre><code>// Path.Combine(exportPathNoZip,entry.FullName) --&gt; \unzip\Files1\Files1.ZIP
  using (ZipArchive archive = ZipFile.OpenRead(Path.Combine(exportPathNoZip,entry.FullName)))
  {
      // These are the files inside the zip file and contain the Excel and the image
      foreach (ZipArchiveEntry item in archive.Entries)
      {
          // Save image to database
          if (item.FullName.EndsWith(".tif", StringComparison.OrdinalIgnoreCase) ||
              item.FullName.EndsWith(".tiff", StringComparison.OrdinalIgnoreCase) ||
              item.FullName.EndsWith(".pdf", StringComparison.OrdinalIgnoreCase))
          {
              byte[] file = File.ReadAllBytes(?????);
              _formerRepository.InsertFormerFileAsBinary(file);
          }
      }
  }
  </code></pre>
  
  <p>But this will not work because the <code>File.ReadAllBytes()</code> will require a path. So what can I do? The storing the files locally will give me a out of disk space exception and without it I have no path.</p>
  
  <p>Please be aware that I'd like to use the <code>System.IO.Compression</code> library for this only.</p>