I have a webpage that gets a file and copies it to a temp directory on the server (at server.mappath(temp). THe file is created using the sessionID as the filename.(98855322.pdf for example) Once the session ends, I want to delete this file, but I'm having trouble doing it. I don't have a problem creating the file and then opening it in my ASP code, but for some reason When I use the FSO in the sub session_OnEnd() in the global.asa file, nothing happens. Could I get a code segment that works for sure that will delete the file in the OnEnd of the global.asa so I can see if my problem is perhaps somewhere else.
This is my pseudo code, as I'm at home and don't have the code in front of me:
set folder fso.getobject(folderpath)
set ofiles to folder.files
for each ofile in ofiles
if instr(1,ofile.name, session.sessionID) > 0 then
fso.deletefile(folder & ofile.name, true)
I am checking the name of the file, and if it contains the sessionID, then I want to delete it. This is the behavior I need, but please don't grade my code segment :)