title: .7z archive from my website is corrupted: "Can not open file as an archive."
body: <p>I know there are other topics about that, but nothing worked.</p>
  
  <p>In my webpage, I allow to download some configuration files</p>
  
  <p>I'm using this code:</p>
  
  <pre><code>public ActionResult DownloadConfigurationFiles()
  {
      var stream = this.HttpContext.GetSessionObj&lt;byte[]&gt;((int)WebVariable.ConfigurationFilesStream);
      if (stream == null)
      {
          return HttpNotFound();
      }
  
      this.HttpContext.ClearSessionObj((int)WebVariable.ConfigurationFilesStream);
      return File(stream, "application/x-7z-compressed", "ConfigurationFiles.7z"); // octet-stream
  }
  </code></pre>
  
  <p>It works perfectly the first time, when when I try again few second later, I download the 7z file, but when I want to open it, I have this error:</p>
  
  <p><img src="https://i.stack.imgur.com/m8Eg8.png" alt="enter image description here"></p>
  
  <p>When I step into the code, it's always the same as the first try when it succeeded... so I don't know why my archive is corrupt..? Is there any way to validate that the archive we build is a valid 7z file?</p>