title: ASP.NET - Store Temporary Files
body: <p>I have a web form that allows users to upload files while opening a ticket in our system.
  The upload is done using the "ajax control toolkit" asyncFileUpload control.</p>
  
  <p>The idea is to have files saved to a temp directory and only save them to the permanent location when the user hits the "commit" button.</p>
  
  <p>I would like to be able to get rid of temp files that are no longer relevant (e.g. the user leaves the page open for a month without posting the form).</p>
  
  <p>What would be the best way to not keep temp files forever.
  Maybe keeping them files in the session?
  Maybe keeping them in the viewstate?</p>
  
  <p>I could add some JS to the page with a timeout and add some code that runs when the user leaves the page. But these ideas are client side solutions. I wouldn't want someone to tamper with the code and leave me rubbish on my system.</p>
  
  <p>Any other idea?</p>
  
  <p>Thanks,
  Summerbulb</p>