问题描述
<%@Pagelanguage="vb"Explicit="True"CodeFile="up.aspx.vb"Inherits="dzja.up_aspx_vb"Debug="true"%><%@ImportNamespace="dzja.upload"%><%--#includefile="upload.inc"--%><html><head><title>上传结果提示</title></head><bodytopmargin="0"><%upload=Newupload_5xSoft()''建立上传对象formPath="upload/"iCount=0If(upload.fileIsNothing)<>TrueThenForEachformNameInupload.file''列出所有上传了的文件file=upload.file(formName)''生成一个文件对象fileExt=LCase(Right(file.filename,4))IfCInt(file.filesize)>10485760ThenResponse.Write("<fontsize=2>文件大小超过了限制10M [<ahref=#onclick=history.go(-1)>重新上传</a>]</font>")Response.End()EndIfIffileExt<>".gif"AndfileExt<>".jpg"AndfileExt<>".swf"AndfileExt<>".ppt"AndfileExt<>".wps"AndfileExt<>".xls"AndfileExt<>".doc"AndfileExt<>".zip"AndfileExt<>".rar"ThenResponse.Write("<fontsize=2>文件格式不正确 [<ahref=#onclick=history.go(-1)>重新上传</a>]</font>")Response.End()EndIffilename=formPath&file.FileNameIfCInt(file.FileSize)>0Then''如果FileSize>0说明有文件数据file.SaveAs(Server.MapPath(filename))''保存文件Response.Write("<fontsize=2>文件"&file.FileName&"上传成功![<ahref=#onclick=history.go(-1)>继续上传</a>]</font>")Response.Write("<script>parent.frmAnnounce.upload.value+='"&filename&"'</script>")IffileExt=".gif"ThenResponse.Write("<script>parent.frmAnnounce.txt_guocheng.value+='[upload=gif]"&filename&"[/upload]'</script>")ElseIffileExt=".jpg"ThenResponse.Write("<script>parent.frmAnnounce.txt_guocheng.value+='[upload=jpg]"&filename&"[/upload]'</script>")ElseIffileExt=".zip"ThenResponse.Write("<script>parent.frmAnnounce.txt_guocheng.value+='[zip]"&filename&"[/zip]'</script>")ElseIffileExt=".xls"ThenResponse.Write("<script>parent.frmAnnounce.txt_guocheng.value+='[xls]"&filename&"[/xls]'</script>")ElseIffileExt=".doc"ThenResponse.Write("<script>parent.frmAnnounce.txt_guocheng.value+='[doc]"&filename&"[/doc]'</script>")ElseIffileExt=".swf"ThenResponse.Write("<script>parent.frmAnnounce.txt_guocheng.value+='[swf]"&filename&"[/swf]'</script>")ElseIffileExt=".ppt"ThenResponse.Write("<script>parent.frmAnnounce.txt_guocheng.value+='[ppt]"&filename&"[/ppt]'</script>")ElseIffileExt=".wps"ThenResponse.Write("<script>parent.frmAnnounce.txt_guocheng.value+='[wps]"&filename&"[/wps]'</script>")ElseIffileExt=".rar"ThenResponse.Write("<script>parent.frmAnnounce.txt_guocheng.value+='[rar]"&filename&"[/rar]'</script>")EndIfiCount=iCount+1EndIffile=NothingNextupload=NothingEndIf%></body></html>
解决方案
解决方案二:
服务器的权限需要设置。google一下有很多