Hi,
I have the following global.asa which should delete any files created during the current session. The file names when created contain the SessionID so each user has their own copy of the files to work on. However this doesnt seem to be working...the files are not deleted when the session times out.....any ideas?
------------------------------------------------------------
<SCRIPT LANGUAGE=VBScript RUNAT=Server>
Sub Session_OnEnd
Dim strAppPath, strFilePath, strFileName
Dim objFSO, objFile
Dim arrFiles(2)
Set objFSO = Server.CreateObject("Scripting.FileSystemObject"
strAppPath = Request.ServerVariables("APPL_PHYSICAL_PATH"
strFilePath = strAppPath & "Config\" & Session("EnvRoot"
arrFiles(0) = strFilePath & "\" & Session.SessionID & "BV.tpl"
arrFiles(1) = strFilePath & "\" & Session.SessionID & "IM.tpl"
arrFiles(2) = strFilePath & "\" & Session.SessionID & "WB.tpl"
For Each strFileName in arrFiles
response.write "File " & strFileName
If (objFSO.FileExists(strFileName)) Then
Set objFile = objFSO.GetFile(strFileName)
objFile.Delete
End If
Next
Set objFSO = Nothing
Set objFile = Nothing
End Sub
</SCRIPT>
I have the following global.asa which should delete any files created during the current session. The file names when created contain the SessionID so each user has their own copy of the files to work on. However this doesnt seem to be working...the files are not deleted when the session times out.....any ideas?
------------------------------------------------------------
<SCRIPT LANGUAGE=VBScript RUNAT=Server>
Sub Session_OnEnd
Dim strAppPath, strFilePath, strFileName
Dim objFSO, objFile
Dim arrFiles(2)
Set objFSO = Server.CreateObject("Scripting.FileSystemObject"
strAppPath = Request.ServerVariables("APPL_PHYSICAL_PATH"
strFilePath = strAppPath & "Config\" & Session("EnvRoot"
arrFiles(0) = strFilePath & "\" & Session.SessionID & "BV.tpl"
arrFiles(1) = strFilePath & "\" & Session.SessionID & "IM.tpl"
arrFiles(2) = strFilePath & "\" & Session.SessionID & "WB.tpl"
For Each strFileName in arrFiles
response.write "File " & strFileName
If (objFSO.FileExists(strFileName)) Then
Set objFile = objFSO.GetFile(strFileName)
objFile.Delete
End If
Next
Set objFSO = Nothing
Set objFile = Nothing
End Sub
</SCRIPT>