I want to upload a file through asp.net mvc and delete the file after the session is destroyed ?
Asked
Active
Viewed 900 times
3 Answers
0
Check out this link which has code in c#. This will tell you how to find a file and delete it, but you must handle checking for session and associated logic. Link

The Muffin Man
- 19,585
- 30
- 119
- 191
-
@mahesh, did this help you, or do you need help writing the other logic? – The Muffin Man Mar 04 '11 at 15:54
0
You can try Session_End in global.asax however the latter is very predictable. If I were you I would delete the temporary files after a certain amount of time e.g. I will delete all files which are one day old.

Community
- 1
- 1

Atanas Korchev
- 30,562
- 8
- 59
- 93
0
if i were to do the same thing in java.. i will write a session listener and fireup deleting files on session invalidation...
check whether same kind of thing exists in ASP.NET ..