ASP.NET - Sending a PDF to the user
<p>I have a process that creates a PDF.  I want these PDF's to be temporary and short lived.  I want to be able to perform the following when the user clicks a button:</p>

<pre><code>string CreatePDF()//returns fileName.pdf
PromptUserToDownloadPDF()
DeletePDF(fileName.pdf)
</code></pre>

<p>I want to avoid having to create a cleanup procedure and deal with any race conditions that arise from users concurrently creating PDF's while running cleanup.  </p>

<p>In winforms, I would synchronously prompt a user to download a file.  How can I do a similar task in web?</p>

<p><strong>UPDATE</strong><br />
Please note that I am using a 3rd party app to create the PDF's (<a href="http://xmlgraphics.apache.org/fop/" rel="nofollow">Apache FOP</a>).  Basically I (will) have a function that invokes the command line:</p>

<blockquote>
  <p>C:>fop "inputfile" "output.pdf"</p>
</blockquote>

<p>So, in memory is not an option...that is unless I could somehow do like....</p>

<pre><code>string CreatePDF()//returns fileName.pdf
string RecreatePDFInMemory()
DeletePDF(fileName.pdf)
PromptUserToDownloadPDF()
</code></pre>
