title: running some process on the file before serving
body: <p>I have upload attachment endpoint that do the following:</p>
  <ul>
  <li><p>convert the file to bytes</p>
  </li>
  <li><p>convert the  bytes to stringBase64</p>
  </li>
  <li><p>encrypting the string (using AES with Key)</p>
  </li>
  <li><p>saving the Encrypted string as txt in the System file</p>
  <pre><code>     app.UseStaticFiles(new StaticFileOptions
       {
           FileProvider = new PhysicalFileProvider(Path.Combine(env.ContentRootPath,&quot;Attachments&quot;)),
           RequestPath = &quot;/Attachments&quot;
       });
  </code></pre>
  </li>
  </ul>
  <p>the above code is how I'm serving the files.
  What I want is ?
  Is there any way to run any code (code for decrypting the txt file with encrypted string) on the Attachment before serving it to be ready for immediate use.</p>
  <p>I'm using netcoreapp3.1</p>