asp 图片上传道数据库 问题!

来源:百度知道 编辑:UC知道 时间:2024/06/18 09:46:04
formPath="paladin"
photointro=HTMLEncode2(upload.form("photointro"))
if right(formPath,1)<>"/" then formPath=formPath&"/"
for each formName in upload.file '列出所有上传了的文件
set file=upload.file(formName) '生成一个文件对象

if file.filesize<0 then
response.redirect "info.asp?info=请选择上传的文件"
response.end
end if
if file.filesize>2000000 then
response.redirect "info.asp?info=文件不得超过2M"
response.end
end if

fileExt=lcase(right(file.filename,4))
if fileEXT<>".gif" and fileEXT<>".jpg" and fileEXT<>".png" and fileEXT<>".bmp" then
response.redirect "info.asp?info=只允许上传gif,jPG,png,bmp文件!"
response.end
end if
Dim Jpeg
FilePath=Server.MapPath("paladin/")'设置上

错误提示是:请选择上传的文件

此判断是

if file.filesize<0 then
response.redirect "info.asp?info=请选择上传的文件"
response.end
end if

意思是文件大小<0字节的提示

也就是说你前面传值过来根本就没有,所以你检查下你上传表单的name名是不是与这个相符

代码不对吧,拷贝一个其他的过去看看