I want to delete a file created by a session when the session ends. I am unable to figure out why the file is not deleted. The session_onstart works fine. Below is the code. Any suggestions?
<%@ Import Namespace="System" %>
<%@ Import Namespace="System.IO"%>
<script runat="server">
Sub Session_OnStart()
'this stuff removed
end sub
Sub Session_OnEnd()
Dim fi As FileInfo
fi = New FileInfo(Session("DownloadFilePath")
if fi.exists then
fi.Delete()
end if
end Sub
</script>
<%@ Import Namespace="System" %>
<%@ Import Namespace="System.IO"%>
<script runat="server">
Sub Session_OnStart()
'this stuff removed
end sub
Sub Session_OnEnd()
Dim fi As FileInfo
fi = New FileInfo(Session("DownloadFilePath")
if fi.exists then
fi.Delete()
end if
end Sub
</script>