<%@ Language=VBScript %>
<!--#include virtual="/inc-freehost-function/FreeHostFunctionMain.asp"-->
<%
gotodir=Request.QueryString ("gotodir")
If session("agentusername")="" Then
	ef=True
	ec="授权非法，有可能是超时造成的。"
elseif not Application("canagnimg")=true then
	ef=True
	ec="管理员设置不允许上传图片。"
elseIf Request.Form ("subname")="" or RegExpTest("[^A-Za-z0-9]",Request.Form ("subname")) Then
	ef=True
	ec="输入内容有非法字符！"
elseIf RegExpTest("[^A-Za-z0-9]",replace(gotodir,"\","")) Then
	ef=True
	ec="目录有非法字符！"
end if
if not ef then

memuser=session("agentusername")
root=Application("agnimgpath")&"\"&memuser

gotodir=Request.Form ("gotodir")
curdir=root&gotodir
newsub=curdir&"\"&Request.Form ("subname")
'Response.Write newsub
if memuser="" or Instr(1,curdir,"..", 1)>0 or Instr(1,curdir,"+", 1)>0 or Instr(1,curdir,"%", 1)>0 or Instr(1,curdir," ", 1)>0 then  Response.Redirect "../e.asp?ec=目录授权出错！"
    Set fso = CreateObject("Scripting.FileSystemObject")
    if fso.FolderExists(newsub) then
    Response.Redirect "../e.asp?ec=这个文件夹已经存在了！"
    else
    fso.CreateFolder(newsub)
    end if
    set fso = nothing
    
Response.Redirect Request.ServerVariables("HTTP_REFERER")
    
end if
if ef then
Response.Redirect "../e.asp?e="&ec
end if%>
