I've created an ASP.NET web form site.
The site allows the user to write articles, and upload attachments as well.
While the user is writing the article, any uploaded attachments are moved into a temp folder
that I created in my site folders, and just when the user submits the article, the attachments are moved to an appropriate path,
But what if the user closed the form, discarding the article? are files in the temp folder will be permanent? of course not!
SO
I want to determine a good scenario for deleting the temp files regularly, without deleting any files that are in pending.
I'm thinking about a scenario:
- Deleting any files that are created for more than an hour! (using file system functions) and that occures in the
Application_Start
event orSession_end
Any better ideas?