=====---有关upload_5xsoft.inc文件的问题,高分求解

limenghao2 2004-05-13 01:50:27
为什么我在前台测试图片上传时没问题,也是图片和文本框的内容都包含,而在后台作产品添加的时候,为什么会报下面的错误呢?所引用的upload_5xsoft.inc是同一个文件,望高手指点。。。。。。

急!!~~~~

错误类型:
Microsoft VBScript 运行时错误 (0x800A0005)
无效的过程调用或参数: 'MidB'
/admin/inc/upload_5xsoft.inc, 第 48 行
...全文
127 12 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
12 条回复
切换为时间正序
请发表友善的回复…
发表回复
elix 2004-05-13
  • 打赏
  • 举报
回复
可怜我。
xjp0000 2004-05-13
  • 打赏
  • 举报
回复
up
king2003 2004-05-13
  • 打赏
  • 举报
回复
楼主也说说原因呀好让我们大家学习学习^_^
sinusoid 2004-05-13
  • 打赏
  • 举报
回复
接分~~~~~~~~
redstorm11 2004-05-13
  • 打赏
  • 举报
回复
蹭点份。。。。。
liuyangxuan 2004-05-13
  • 打赏
  • 举报
回复
我也来搞分来了!
xxrl 2004-05-13
  • 打赏
  • 举报
回复
搞定啦?恭喜喽,刚刚来就搞定了,呵呵,
limenghao2 2004-05-13
  • 打赏
  • 举报
回复
呵,搞掂了
limenghao2 2004-05-13
  • 打赏
  • 举报
回复
静态页面:prosend.htm


上传页面:prosend.asp
<!--#include file="conn.asp"--> '数据库文件
<!--#include file="comm.asp"--> '函数文件
<!--#include file="upload_5xsoft.inc"-->
<%
call SavePic("../../Product/photo/")
%>


comm.asp页面:
'***** 输出简写 *****
sub echo(s)
Response.write s & chr(13) '输出单行内容, 加“回车”
end sub

'***** 结束简写 ****
sub endit()
Response.end
end sub

'***** 返回 RecordSet ****
function GetRS()
set GetRs = Server.CreateObject("adodb.recordset")
end function

'***** 返回当前页面URL ****
function SelfUrl()
set SelfUrl = Request.ServerVariables("Script_Name")
end function

'***** 是否为注册用户 ****
function IsRegUser()
if isEmpty( session("oskey") ) then
IsRegUser = false
else
IsRegUser = true
end if
end function

' ***** insert / update SQL语句生成函数 *****
' 使用范例
' f = "a|b|c" // 字段名列表
' v = "1|2|3" // 字段值列表
' Response.write GetSQL("update", "aa", f, v, "id=1")
function GetSQL(c, table, f, v, condition )
dim sql

' 过滤掉单引号
v = replace(v, "'", "’")

' 开始按|拆分字串成数组
field = split(f, "|")
value = split(v, "|")

select case c
case "insert":
sql = "INSERT INTO " & table & "("
sql = sql & join(field, ",") & ") VALUES('"
sql = sql & join(value, "','") & "')"

case "update":
n = ubound(field)
sql = "UPDATE " & table & " SET "
for i=0 to n
sql = sql & field(i) & "='" & value(i) & "'"
if i<n then sql = sql & ","
next
sql = sql & " WHERE "& condition

end select

GetSQL = sql
end function

'***** 判断是否为页面提交动作 *****
function IsPost()
if Request.ServerVariables("REQUEST_METHOD") = "POST" then
IsPost = true
else
IsPost = false
end if
end function

'***** 用于消息提示 *****
function ShowMsg( msg )
echo "<script>alert('"& msg &"')</script>"
end function

'***** 用于跳转页面 *****
function GoUrl( url )
echo "<script>window.location='"& url &"';</script>"
call endit ' 结束页面输出
end function

'***** 用于屏蔽一些特殊字符 *****
function EscapeChar( s )
s = replace(s, "'", "‘") ' 处理引号
s = replace(s, """", "”")
s = replace(s, ",", ",")
s = replace(s, ")", ")")
s = replace(s, "(", "(")
s = replace(s, "|", "-") ' | 为首要屏蔽的字符, 否则会直接影响 GetSQL 的工作
EscapeChar = s
end function

Function getExt(ename)'得到文件扩展名
getExt = right(ename, 3)
End Function

Function isPIC(fileName) '检测是否为图片类型

ext = getExt(fileName)
picType = "jpg,gif,png" '图片类型 (使用","将图片格式分开)
isPIC = False

typeList = split(picType, ",")

For ii = LBound(typeList) To UBound(typeList)
If UCase(ext) = UCase(typeList(ii)) Then
isPIC = True
Exit For
End If
Next

End Function

'*************无组件上传图片函数**************'
'*** 调用方法:Call SavePic(path) *******'
'*** 页面使用时需包包含upload_5xsoft.inc文件 *'
'*** 作者:李建军 日期:2004-05-11 *****'
'*** 获得图片名称用filearray(0,1,2,3)得到 ***'
'*********************************************'
dim filearray
reDim fileArray(0)
dim upload,file,filename
Function SavePic(path)
set upload=new upload_5xsoft ''建立上传对象
i = 0
if right(path,1)<>"/" then
path = path&"/"
end if
for each formName in upload.objFile ''列出所有上传了的文件
thefilename = year(date())&month(now())&day(now())&hour(now())&minute(now())&second(now())&i
set file=upload.file(formname)
filename2 = getext(file.FileName)
if IsPic(filename2) then
if file.FileSize < 0 or file.FileSize > 200*1024 then
echo "<div align=center><font color=red><b>图片 "&file.fileName&" 文件超过200K,请核对后重新上传!</b></font><br><br>"
echo "<a href='javascript:window.history.back()'><font color= blue><b>返回</b></div></a>"
exit for
else
filename = thefilename&"."&filename2
fileArray(i) = filename
i = i + 1
reDim Preserve fileArray(i)
file.SaveAs Server.mappath(path & filename)
end if
else
echo "<div align=center><font color=red><b>文件 "&file.fileName&" 类型不对,请核对后重新上传!只支持JPG\GIF\PNG图片类型!</b></font><br><br>"
echo "<a href='javascript:window.history.back()'><font color= blue><b>返回</b></div></a>"
exit for
end if
next
End function

'*********无组件上传图片结束函数**********
Function EndSavePic()
set file=nothing
set upload=nothing
End Function
anwell 2004-05-13
  • 打赏
  • 举报
回复
是有这个问题,
把错误忽略掉就好了,不影响正常使用.

on error resume next
skyboy0720 2004-05-13
  • 打赏
  • 举报
回复
代码呢!
zhang17 2004-05-13
  • 打赏
  • 举报
回复
把上传代码贴出来

28,409

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧