<!--#include file= "conn/conn.asp"-->
<%
If session ("username") = "" or Session ("Use_type") <> "Super Administrator" then
Response. Write ("<script language= ' JavaScript ' >alert (' does not have sufficient permissions to operate the site file! '); History.back ();</script> ")
Response.End
End If
Dim Path,filename,filetype,fileconten,fso
Path=request ("path")
Filename=html_encode (Request ("filename"))
Filecontent=request ("Filecontent")
Filetype=request ("filetype")
If InStr (FileName, "*") >0 or InStr (filename, "?") >0 or InStr (filename, "&") >0 or len (filename) <0 or filename= "" Then
Response. Write ("<script language= ' JavaScript ' >alert (' illegal filename! '); History.back ();</script> ")
Response.End
Else
Set Fso=server.createobject ("Scripting.FileSystemObject")
If Fso.fileexists (Path&filename&filetype) Then
Response. Write ("<script language= ' JavaScript" >alert (' filename has been saved, please choose again! '); History.back ();</script> ")
Response. End ()
End If
Set Input=fso.createtextfile (Server.MapPath (Path&filename&filetype), true)
Input.writeline (filecontent)
Input.close
If Err Then
Response. Write (' <script language= ' JavaScript ' >alert (' unexpected error! ' Save file failed! '); History.back ();</script> ")
Else
%>
<script language= "" >
var pathh= "<%=replace" (Session ("ScriptName"), "", "/")%> ";
Alert ("File success!");
window.location= "Try/mange_page.asp?pathh=" +PATHH;
</script>
<%
' Response.Redirect ("try/mange_page.asp")
End If
End If
%>