Yeah this drove me nuts too... unfortunately you cannot use the
server.mappath function in the Session_OnEnd subroutine.
Scott
> I have a page that creates text files for users to download. When the
user
> clicks home I call abandon.asp explicitly end the session then redirect
the
> user to the home page. In my global.asa Session_OnEnd I have this:
>
> Sub Session_OnEnd
> Dim oFSO, strcsvFolderPath
> strcsvFolderPath = "d:\inetpub\wwwroot\waterobs\download\"
> 'strcsvFolderPath = server.MapPath("\waterobs\download")
> set oFSO = Server.CreateObject("Scripting.FileSystemObject")
> 'oFSO.DeleteFile (strcsvFolderPath & "\" & Session("FileName")
> &".csv")
> oFSO.DeleteFile (strcsvFolderPath & Session("FileName") &".csv")
> set oFSO = nothing
> End Sub
>
> Everything works fine when I use the physical path. But when I try to
use
> server.mapPath it doesn't delete the file. The two commented lines are
the
> ones that don't work. I just want to know why.
>