-
File clean up
Ive created a component which allows me to take a dataset and make it into a comma seperated value file. After the file is created the user is given the link to download it and they can however after they do this and exit out of the web app im still left with the file and after many users do this i have a ton of files sitting on the server that I no longer need and ideas on the best way to take care of this problem?
-
How about allowing say 5 files to be created and before creating a new file check to see if there 5 files. If there are overwrite the oldest one and rename it.
-
thats an idea currently i am using there session id to give the file a name didnt think about doing it that way Ill give it a try I was trying to think of a way in which somehow after the file was downloaded to delete it. The application i have is running on an intranet and it is possible that with in the time a file is created 5 other users could also have created a file and effectivly deleted the users file before the have been given a chance to download it I fear. Though you have given me some ideas here so I will try to work with that thanks for the suggestion.
-
going further..use the session id as a file name, then in the session onend in the global.asax, just can delete files with the filename thta contains the session id of the timing out session.
-
Does global.asax work like webconfig where it inherits the the parent one if it doesnt exist or does it have to exist for the applicaiton to work
-
I dont believe it is like web.config. Each application would have its own global.asax in its root directory
-
Well i guess modifying the six or so apps that I have with that isnt the end of the world. So would the all run at the same time when the session ends? If the user went to app a and created a file then went to app b and created a file then went to app c and created a file then the session times all three apps will execute there events?
-
It really depends on what you mean by application. When I say application, I am referring to what the virtual directory points to. If all those apps are running in that same virtual directory, then 1 global.asax is all that is needed.
-
Well I do have some ideas formed Im not sure which way im going to go at this moment. It should defintly be intresting how it turns out.