主题:AspUpload 上传组件问题
AspUpload 上传组件在本地调用没有问题 可是传到空间就无法显示了 出现了HTTP:500错
代码:
<!-- #include file="include/skin.asp" -->
<!-- #include file="include/upload_config.asp" -->
<!-- #include file="include/jk_convert.asp" -->
<!-- #include file="include/jk_enurl.asp" -->
<!-- #include file="include/jk_msort.asp" -->
<!-- #include file="include/jk_val_code.asp" -->
<%
dim formname,upload_path,upload_type,upload_size,upload_mn,upload_mode,up_sort,up_valcode
dim session_for,go_back
session_for=joekoe_cms.web_cookies&"_admin_"
go_back="<a href='javascript:history.back(1)'>返回上一页</a>"
'--------------------------------------------------------------------------
Server.ScriptTimeOut=5000
'--------------------------------------------------------------------------tit="文件上传"
is_refur_true=false
if session(session_for&"admin")="joekoe_admin" then
call web_head(0,1,5,0,0)
login_username=session(session_for&"admines")
login_mode=format_power2(1,1)
else
call web_head(2,1,5,0,0)
end if
call msort_start(0)
call convert_load(login_mode)
function upsort_path(pvar)
dim si
upsort_path=true
if pvar="face" then exit function
upsort_path=msort_true(pvar)
end function
%>
</head>
<body topmargin=0 leftmargin=0>
<table border=0 height='100%' width='100%' cellspacing=0 cellpadding=0 class=bg>
<tr><td height='100%'>
<script language=javascript>
if (top.location==self.location) { top.location="/" }
</script>
<%
dim dim_upload,upload,up_text,up_path,uptemp,uppath,up_name,up_temp,upfile,upfilename,upfile_name,upfile_name2,upfilesize,upid,today_num,st,upcount
upcount=1
today_num=0
if var_null(login_username)="" and session(session_for&"admin")="" then
response.write web_nologin
else
dim_upload=split(web_dim(14),"|")
upload_path=web_dim(13)
upload_type=dim_upload(0)
if instr(","&upload_type&",",",asp,")>1 then
up_temp=","&upload_type&","
up_temp=replace(up_temp,",asp,",",")
upload_type=left(up_temp,len(up_temp)-1)
upload_type=right(upload_type,len(upload_type)-1)
end if
upload_size=dim_upload(1)
upload_mn=dim_upload(2)
upload_mode=dim_upload(3)
if not(isnumeric(upload_size)) then upload_size=0
if not(isnumeric(upload_mn)) then upload_mn=1
upload_mn=format_convert(upload_mn,"+")
if not isnumeric(upload_mode) then upload_mode=0
if upload_nums()=true then
select case action
case "upfile"
if joekoe_cms.post_chk()=false then
response.write web_nopost
else
call upload_way()
response.write uptemp
end if
case else
call upload_main()
end select
end if
erase dim_upload
end if
call msort_end()
call web_clear(0)
%>
</td></tr>
</table>
</body>
</html>
<%
sub upload_0() '无组件上传
up_name=trim(upload.form("up_name"))
up_text=trim(upload.form("up_text"))
up_path=trim(upload.form("up_path"))
up_temp=trim(upload.form("up_temp"))
up_valcode=trim(upload.form("valcode"))
call upload_val_par()
if not up_val_chk(uppath) then
call upload_msg(6)
set upfile=nothing
exit sub
end if
set upfile=upload.file("file_name1")
upfilesize=upfile.filesize
if upfilesize<=0 then
call upload_msg(1)
set upfile=nothing
exit sub
end if
upfilename=upfile.fileName
if upfilesize>(upload_size*1024) then
call upload_msg(2)
set upfile=nothing
exit sub
end if
upfile_name=right(upfilename,(len(upfilename)-Instr(upfilename,".")))
upfile_name=lcase(upfile_name)
if instr(","&upload_type&",",","&upfile_name&",")<=0 then
call upload_msg(3)
set upfile=nothing
exit sub
end if
upfile_name2=upfile_name
upfile_name=up_name&"."&upfile_name
upfile.saveas up_path&upfile_name
call upload_data()
call upload_msg(4)
set upfile=nothing
end sub
sub upload_1() 'LyfUpload
up_name=trim(upload.request("up_name"))
up_text=trim(upload.request("up_text"))
up_path=trim(upload.request("up_path"))
up_temp=trim(upload.request("up_temp"))
up_valcode=trim(upload.request("valcode"))
if var_null(up_temp)="" then
call upload_msg(1)
exit sub
end if
upload.maxsize=upload_size*1024
upload.extname=upload_type
call upload_val_par()
if not up_val_chk(uppath) then
call upload_msg(6)
set upfile=nothing
exit sub
end if
upfile_name=apart_filename(up_temp,2,"\")
upfile_name=lcase(upfile_name)
if instr(","&upload_type&",",","&upfile_name&",")>0 then
upfile_name2=upfile_name
upfile_name=up_name&"."&upfile_name
end if
if right(up_path,1)="/" then up_path=left(up_path,len(up_path)-1)
if right(up_path,1)<>"\" then up_path=up_path&"\"
st=upload.savefile("file_name1",up_path,true,upfile_name)
select case cstr(st)
case "0"
call upload_msg(2)
exit sub
case "1"
call upload_msg(3)
exit sub
case "3"
if session(session_for&"admin")<>"joekoe_admin" then
call upload_msg(0)
exit sub
end if
upfilesize=upload.filesize
case ""
call upload_msg(5)
exit sub
case else
upfilesize=upload.filesize
end select
call upload_data()
call upload_msg(4)
end sub
sub upload_2() 'Aspupload
on error resume next
if session(session_for&"admin")="joekoe_admin" or session(session_for&"uploadtype")="s" then
upload.overwritefiles=true '能复盖
else
upload.overwritefiles=false '不能复盖
end if
upload.ignorenopost=true
upload.setmaxSize upload_size*1024,true '限制大小
upcount=upload.save
if err.number=8 then
err.clear
call upload_msg(2)
exit sub
end if
if err<>0 then 'Err.Description
call upload_msg(5)
exit sub
end if
up_name=trim(upload.form("up_name"))
up_text=trim(upload.form("up_text"))
up_path=trim(upload.form("up_path"))
up_temp=trim(upload.form("up_temp"))
up_valcode=trim(upload.form("valcode"))
call upload_val_par()
if not up_val_chk(uppath) then
call upload_msg(6)
set upfile=nothing
exit sub
end if
set upfile=upload.files("file_name1")
if upcount<>1 then
call upload_msg(1)
set upfile=nothing
exit sub
end if
upfilename=upfile.filename
upfilesize=upfile.Size
upfile_name=apart_filename(upfilename,2,".")
upfile_name=lcase(upfile_name)
if instr(","&upload_type&",",","&upfile_name&",")<=0 then
call upload_msg(3)
set upfile=nothing
exit sub
end if
upfile_name2=upfile_name
upfile_name=up_name&"."&upfile_name
upfile.saveas up_path&upfile_name
call upload_data()
call upload_msg(4)
set upfile=nothing
end sub
代码:
<!-- #include file="include/skin.asp" -->
<!-- #include file="include/upload_config.asp" -->
<!-- #include file="include/jk_convert.asp" -->
<!-- #include file="include/jk_enurl.asp" -->
<!-- #include file="include/jk_msort.asp" -->
<!-- #include file="include/jk_val_code.asp" -->
<%
dim formname,upload_path,upload_type,upload_size,upload_mn,upload_mode,up_sort,up_valcode
dim session_for,go_back
session_for=joekoe_cms.web_cookies&"_admin_"
go_back="<a href='javascript:history.back(1)'>返回上一页</a>"
'--------------------------------------------------------------------------
Server.ScriptTimeOut=5000
'--------------------------------------------------------------------------tit="文件上传"
is_refur_true=false
if session(session_for&"admin")="joekoe_admin" then
call web_head(0,1,5,0,0)
login_username=session(session_for&"admines")
login_mode=format_power2(1,1)
else
call web_head(2,1,5,0,0)
end if
call msort_start(0)
call convert_load(login_mode)
function upsort_path(pvar)
dim si
upsort_path=true
if pvar="face" then exit function
upsort_path=msort_true(pvar)
end function
%>
</head>
<body topmargin=0 leftmargin=0>
<table border=0 height='100%' width='100%' cellspacing=0 cellpadding=0 class=bg>
<tr><td height='100%'>
<script language=javascript>
if (top.location==self.location) { top.location="/" }
</script>
<%
dim dim_upload,upload,up_text,up_path,uptemp,uppath,up_name,up_temp,upfile,upfilename,upfile_name,upfile_name2,upfilesize,upid,today_num,st,upcount
upcount=1
today_num=0
if var_null(login_username)="" and session(session_for&"admin")="" then
response.write web_nologin
else
dim_upload=split(web_dim(14),"|")
upload_path=web_dim(13)
upload_type=dim_upload(0)
if instr(","&upload_type&",",",asp,")>1 then
up_temp=","&upload_type&","
up_temp=replace(up_temp,",asp,",",")
upload_type=left(up_temp,len(up_temp)-1)
upload_type=right(upload_type,len(upload_type)-1)
end if
upload_size=dim_upload(1)
upload_mn=dim_upload(2)
upload_mode=dim_upload(3)
if not(isnumeric(upload_size)) then upload_size=0
if not(isnumeric(upload_mn)) then upload_mn=1
upload_mn=format_convert(upload_mn,"+")
if not isnumeric(upload_mode) then upload_mode=0
if upload_nums()=true then
select case action
case "upfile"
if joekoe_cms.post_chk()=false then
response.write web_nopost
else
call upload_way()
response.write uptemp
end if
case else
call upload_main()
end select
end if
erase dim_upload
end if
call msort_end()
call web_clear(0)
%>
</td></tr>
</table>
</body>
</html>
<%
sub upload_0() '无组件上传
up_name=trim(upload.form("up_name"))
up_text=trim(upload.form("up_text"))
up_path=trim(upload.form("up_path"))
up_temp=trim(upload.form("up_temp"))
up_valcode=trim(upload.form("valcode"))
call upload_val_par()
if not up_val_chk(uppath) then
call upload_msg(6)
set upfile=nothing
exit sub
end if
set upfile=upload.file("file_name1")
upfilesize=upfile.filesize
if upfilesize<=0 then
call upload_msg(1)
set upfile=nothing
exit sub
end if
upfilename=upfile.fileName
if upfilesize>(upload_size*1024) then
call upload_msg(2)
set upfile=nothing
exit sub
end if
upfile_name=right(upfilename,(len(upfilename)-Instr(upfilename,".")))
upfile_name=lcase(upfile_name)
if instr(","&upload_type&",",","&upfile_name&",")<=0 then
call upload_msg(3)
set upfile=nothing
exit sub
end if
upfile_name2=upfile_name
upfile_name=up_name&"."&upfile_name
upfile.saveas up_path&upfile_name
call upload_data()
call upload_msg(4)
set upfile=nothing
end sub
sub upload_1() 'LyfUpload
up_name=trim(upload.request("up_name"))
up_text=trim(upload.request("up_text"))
up_path=trim(upload.request("up_path"))
up_temp=trim(upload.request("up_temp"))
up_valcode=trim(upload.request("valcode"))
if var_null(up_temp)="" then
call upload_msg(1)
exit sub
end if
upload.maxsize=upload_size*1024
upload.extname=upload_type
call upload_val_par()
if not up_val_chk(uppath) then
call upload_msg(6)
set upfile=nothing
exit sub
end if
upfile_name=apart_filename(up_temp,2,"\")
upfile_name=lcase(upfile_name)
if instr(","&upload_type&",",","&upfile_name&",")>0 then
upfile_name2=upfile_name
upfile_name=up_name&"."&upfile_name
end if
if right(up_path,1)="/" then up_path=left(up_path,len(up_path)-1)
if right(up_path,1)<>"\" then up_path=up_path&"\"
st=upload.savefile("file_name1",up_path,true,upfile_name)
select case cstr(st)
case "0"
call upload_msg(2)
exit sub
case "1"
call upload_msg(3)
exit sub
case "3"
if session(session_for&"admin")<>"joekoe_admin" then
call upload_msg(0)
exit sub
end if
upfilesize=upload.filesize
case ""
call upload_msg(5)
exit sub
case else
upfilesize=upload.filesize
end select
call upload_data()
call upload_msg(4)
end sub
sub upload_2() 'Aspupload
on error resume next
if session(session_for&"admin")="joekoe_admin" or session(session_for&"uploadtype")="s" then
upload.overwritefiles=true '能复盖
else
upload.overwritefiles=false '不能复盖
end if
upload.ignorenopost=true
upload.setmaxSize upload_size*1024,true '限制大小
upcount=upload.save
if err.number=8 then
err.clear
call upload_msg(2)
exit sub
end if
if err<>0 then 'Err.Description
call upload_msg(5)
exit sub
end if
up_name=trim(upload.form("up_name"))
up_text=trim(upload.form("up_text"))
up_path=trim(upload.form("up_path"))
up_temp=trim(upload.form("up_temp"))
up_valcode=trim(upload.form("valcode"))
call upload_val_par()
if not up_val_chk(uppath) then
call upload_msg(6)
set upfile=nothing
exit sub
end if
set upfile=upload.files("file_name1")
if upcount<>1 then
call upload_msg(1)
set upfile=nothing
exit sub
end if
upfilename=upfile.filename
upfilesize=upfile.Size
upfile_name=apart_filename(upfilename,2,".")
upfile_name=lcase(upfile_name)
if instr(","&upload_type&",",","&upfile_name&",")<=0 then
call upload_msg(3)
set upfile=nothing
exit sub
end if
upfile_name2=upfile_name
upfile_name=up_name&"."&upfile_name
upfile.saveas up_path&upfile_name
call upload_data()
call upload_msg(4)
set upfile=nothing
end sub