Note that there are some explanatory texts on larger screens.

plurals
  1. POClearing temp Uploaded Files folder in asp.net
    primarykey
    data
    text
    <p>I was wondering what the best practice was for the following scenario:</p> <p>A user uploads a file on page A. the file is stored in a unique temp folder (based on user GUID). The user is redirected to page B where validation of the file is performed and eventually redirected to page C.</p> <p>All of these pages use the file(s) uploaded by the user.</p> <p>Obviously, at some point I want to remove those files to prevent the server from getting stuffed with temp files. I've got a couple of solutions that come to mind, but I was wondering if there is a better solution/which one of those is the best.:</p> <ul> <li><p>Solution 1: Delete the file after the process is completed (in this case, on Page c). I don't think this is a good solution, because it's well possible that the user cancels his action somewhere halfway (page B). This would still cause temp files to stay on the server</p></li> <li><p>Solution 2: On onload of page A, do a check for in the main temp folder, and delete all files &amp; folders which haven't been used in the last x days</p></li> <li><p>Solution 3 (which is probably the cleanest): write a small console app that will do the same as solution 2, and schedule it with windows task scheduler to run once a day at night</p></li> <li><p>Solution 4: Same as 3, but in a windows service. I'd think it's a bit overkill to create a windows service for that.</p></li> </ul> <p>Now, I'm tempted to say 3 is the cleanest, but since it seems a bit overkill for the app I'm having, I think the combination of solution 1 &amp; 2 make a good alternative.</p> <p>Any suggestions / feedback?</p> <p>Thanks!</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload