' Parameter: File name (relative path)
Public Function Deleteafile (filepath)
If filepath = "" Or IsNull (filepath) Then Exit Function
Dim I,filesplit,temp,filename,fileextname,temppath
Filesplit = Split (filepath, "|")
On Error Resume Next
For i = 0 to UBound (filesplit)
temp = Server.MapPath (Filesplit (i))
Fileextname = Getfileextname (filepath) (1)
TempPath = Replace (temp, "." & Fileextname, "*." & Fileextname)
If ofso.fileexists (temp) Then ofso.deletefile (TempPath)
Next
If Err <> 0 Then Err.Clear
End Function
Dim Forumname,urlpath
Dim FSO
Forumname = Request.QueryString ("Oppara")
If forumname = "" Then lib.alerterror 3, "no form path specified",-1
URLPath = Request.QueryString ("Opurl")
If URLPath = "" Then lib.alerterror 3, "No file path specified",-1
Set fso = new Filelib
Response. Write (URLPath)
Call FSO. Deleteafile (URLPath)
%>
<script language= "JavaScript" >
if (opener.<% = Forumname%>.value!= "")
{
opener.<% = Forumname%>.value= "";
Alert ("The operation has been successfully removed, please proceed to the next step");
}
else {
Alert (' File not found, Operation terminated ');
}
Window.close ()
</script>
<%
Set FSO = Nothing
%>