asp提交图片错误 请指出错误

来源:百度知道 编辑:UC知道 时间:2024/06/15 19:41:10
<!--#include file="UpLoad.inc"-->
<%
if Request.QueryString("action")="upfile" then
%>
<html>
<head>
<title>上传图片</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>
<body topmargin="0" leftmargin="0">
<table width=100% border=0 cellspacing="0" cellpadding="0"><tr><td class=tablebody1 width=100% height=100% >
<%
dim upload,file,formName,formPath,filename,fileExt
dim ranNum
call UpFile()
'===========无组件上传(upload_0)====================
sub UpFile()
set upload=new UpFile_Class '建立上传对象
upload.GetData (50*1024) '取得上传数据,此处即为500 K

if upload.err > 0 then
select case upload.err
case 1
Response.Write "请先选择你要上传的文件 [ <a href=# onclick=history.go(-1)>重新上传</a>

出错原因都没贴出来。一般这种上传组件都是通用代码,一般没人会去改动,所以程序出的情况不大。检查你上传的图片大小是否超过500K,图片格式是否正确这个程序的判断是gif,jpg,bmp,jpeg四种格式。传参是不是出错。
<form onSubmit="this.action='upfile.asp?action=upfile&fn='+this.file.value" method="post" enctype="multipart/form-data">