标题:[求助] 新手求助:文件上传问题!!(二)
取消只看楼主
topsun321
Rank: 1
等 级:新手上路
帖 子:18
专家分:0
注 册:2006-4-26
 问题点数:0 回复次数:0 
[求助] 新手求助:文件上传问题!!(二)

错误提示如下:
ADODB.Stream 错误 '800a0bbc'

写入文件失败。

/qiye_5/upfile/upload.inc,行175

上传模块代码:
<!--#include FILE="upload.inc"-->
<%
dim upload,file,formName,formPath,iCount
set upload=new upload_F
function MakedownName()
dim fname
fname = now()
fname = replace(fname,"-","")
fname = replace(fname," ","")
fname = replace(fname,":","")
fname = replace(fname,"PM","")
fname = replace(fname,"AM","")
fname = replace(fname,"上午","")
fname = replace(fname,"下午","")
fname = int(fname) + int((10-1+1)*Rnd + 1)
MakedownName=fname
end function
formPath="../img/"
iCount=0
for each formName in upload.file ''列出所有上传了的文件
set file=upload.file(formName) ''生成一个文件对象
if file.FileSize>0 then ''如果 FileSize > 0 说明有文件数据
newname=MakedownName()&"."&mid(file.FileName,InStrRev(file.FileName, ".")+1)

file.SaveAs Server.mappath(formPath&newname) ''保存文件
iCount=iCount+1
else
response.write "未找到文件 &nbsp;&nbsp;<A HREF=javascript:history.back(1)>返回</A>"
response.end
end if
next
%>
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" href="../style.css" type="text/css">
</head>

<body>
<p align="center">文件:</p>
<p align="center">
<%
response.write "<font style=""color:#000000; background-color: #FF0000"">http://"&Request.ServerVariables("SERVER_NAME")&"/img/"&newname&"</font> ("&cint(file.FileSize/1024)&"K) 上传 成功!<br>"
%>
</p>
<p align="center">
请复制红底黑字的文件地址,不要有空格。
</p>
<p align="center">
<a href="upload.asp">继续上传</a>
</p>
<p align="center">
下面是您上传的文件予览
</p>
<p align="center">
<%
if (mid(file.FileName,InStrRev(file.FileName, ".")+1))="swf" then
%>
<EMBED src="../img/<%=newname%>" quality=high WIDTH=300 HEIGHT=280 TYPE='application/x-shockwave-flash'></EMBED>
<%else%>
<img src="../img/<%=newname%>">
<%end if%>
</p>
<%
set file=nothing
set upload=nothing ''删除此对象
%>
</body>
</html>

搜索更多相关主题的帖子: fname replace upload 
2006-05-08 13:09



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-62549-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.110834 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved