我的确是菜鸟 发布留言 2008-10-25 13:38
自己制作的网站上传图片出现无法显示 急求解决办法!
Upload_Photo.asp
---------------------------------------------------------------------------------------------------<%@language=vbscript codepage=936 %>
<%
AdminName=replace(session("AdminName"),"'","")
if AdminName="" then
call CloseConn()
response.redirect "admin/login.asp"
response.End()
end if
Password=replace(session("AdminPassword"),"'","")
if Password="" then
call CloseConn()
response.redirect "admin/login.asp"
response.End()
end if
sql="select UserName from Admin where UserName='" & AdminName & "' and Password='" & Password & "'"
set rs=conn.execute(sql)
if rs.eof and rs.bof then
rs.close
response.Redirect("admin/login.asp")
response.End()
end if
%>
<%
EditName=request("EditName")
ImageName=request("ImageName")
%>
---------------------------------------------------------------------------------------------------
Upfile_Photo.asp
---------------------------------------------------------------------------------------------------
<%@language=vbscript codepage=936 %>
<%@language=vbscript codepage=936 %>
<%
AdminName=replace(session("AdminName"),"'","")
if AdminName="" then
call CloseConn()
response.redirect "admin/login.asp"
response.End()
end if
Password=replace(session("AdminPassword"),"'","")
if Password="" then
call CloseConn()
response.redirect "admin/login.asp"
response.End()
end if
sql="select UserName from Admin where UserName='" & AdminName & "' and Password='" & Password & "'"
set rs=conn.execute(sql)
if rs.eof and rs.bof then
rs.close
response.Redirect("admin/login.asp")
response.End()
end if
%>
<%
dim upload,oFile,formName,SavePath,filename,fileExt,oFileSize
dim EnableUpload
dim arrUpFileType
dim ranNum
dim msg,FoundErr
msg=""
FoundErr=false
EnableUpload=false
%>
<%
call upload_0() '使用化境无组件上传类
%>
<%
sub upload_0() '使用化境无组件上传类
set upload=new upfile_class ''建立上传对象
upload.GetData(104857600) '取得上传数据,限制最大上传100M
if upload.err > 0 then '如果出错
select case upload.err
case 1
response.write "请先选择你要上传的文件!"
case 2
response.write "你上传的文件总大小超出了最大限制(100M)"
end select
response.end
end if
SavePath = SaveUpFilesPath '存放上传文件的目录
if right(SavePath,1)<>"/" then SavePath=SavePath&"/" '在目录后加(/)
for each formName in upload.file '列出所有上传了的文件
set ofile=upload.file(formName) '生成一个文件对象
oFileSize=ofile.filesize
if oFileSize<100 then
msg="请先选择你要上传的文件!"
FoundErr=True
else
select case PhotoUrlID
case 0
if oFileSize>(MaxFileSize*1024) then
msg="文件大小超过了限制,最大只能上传" & CStr(MaxFileSize) & "K的文件!"
FoundErr=true
end if
case 1
if oFileSize>(10000*1024) then
msg="文件大小超过了限制,最大只能上传10M的文件!"
FoundErr=true
end if
end select
end if
fileExt=lcase(ofile.FileExt)
arrUpFileType=split(UpFileType,"|")
for i=0 to ubound(arrUpFileType)
if fileEXT=trim(arrUpFileType(i)) then
EnableUpload=true
exit for
end if
next
if fileEXT="asp" or fileEXT="asa" or fileEXT="aspx" then
EnableUpload=false
end if
if EnableUpload=false then
msg="这种文件类型不允许上传!\n\n只允许上传这几种文件类型:" & UpFileType
FoundErr=true
end if
strJS="" & vbcrlf
response.write strJS
set file=nothing
next
set upload=nothing
end sub
%>
-------------------------------------------------------------------------------------------------------------------------------------------------------------
以上是那两个文件 每次上传的时候点击“上传”都是显示:
无法显示网页
您要访问的网页有问题,无法显示。
-------------------------------------------------------
请尝试以下操作:
打开 127.0.0.1 主页,然后查找指向您感兴趣信息的链接。
单击刷新按钮,或以后再试。
单击搜索,寻找 Internet 上的信息。
也可查看相关站点列表。
HTTP 500 - 内部服务器错误
Internet Explorer
我的确是菜鸟 发布留言 2008-10-25 13:40
上传按钮:
| 页: [1]