Sub Session_OnEnd strTempFileName = Session("TempFileName") Set objFS = Server.CreateObject("Scripting.FileSystemObject") If objFS.FileExists(strTempFileName) Then objFS.DeleteFile strTempFileName End If Set objFS = Nothing End Sub