注册 登录
编程论坛 ASP技术论坛

asp 程序在 sr 2008 出现 800a000d 类型错误,帮我看看阿!!!file.FileName 类型错误

cxv818 发布于 2010-08-24 10:58, 392 次点击
<%@ codepage ="936" %>
<!--#include file="../../conn/dbconn2.asp"-->
<%
dim cimg
dim rs
dim sql
dim id
dim upload,file,formName,formPath,thename,imgs,file2,fs
id=request("id")
cimg=request("cimg")
set rs=server.createobject("adodb.recordset")
sql="select cimg from qyml where id="&id
rs.open sql,conn,1,3
file2=rs("cimg")
set fs=server.CreateObject("scripting.filesystemobject")
file2=server.MapPath(file2)
if fs.FileExists(file2) then
fs.DeleteFile file2,true
end if
%>
<!--#include FILE="upload.inc"-->
<%
set upload=new upload_5xSoft ''建立上传对象
'--------将日期转化成文件名--------
formPath="pic/"
set file=upload.file("cimg") ''生成一个文件对象
if file.FileSize>0 then ''如果 FileSize > 0 说明有文件数据
thename=year(now)&month(now)&day(now)&hour(now)&minute(now)&second(now)&right(file.filename,4)
file.filename=thename

                                           ********
                                           *******
******* 这里出错 说file.FileName 类型错误***************

file.SaveAs Server.mappath(formPath&file.FileName)




imgs=File.FileName
else
response.write "未找到文件 &nbsp;&nbsp;<A HREF=javascript:history.back(1)>返回</A>"
response.end
end if
rs("cimg")="pic/"&imgs
rs.Update
rs.close


response.write file.FilePath&file.FileName&" ("&cint(file.FileSize/1024)&"K) 上传 成功!<br>"



Set rs=nothing
Conn.Close
Set Conn=nothing
%>



<script language=javascript>




</script>
<LINK href="../../css/Style.css" rel=stylesheet type=text/css>
<BODY>
<p> </p>
<div align="center">
<center>
<TABLE border=1 bordercolorlight='#DEDEDE' bordercolordark=#DEDEDE cellspacing=0 cellpadding=3 style="border-collapse: collapse" bordercolor="#111111" width="295" height="122">
<TR>
<TD width="220" height="86">
<p align="center"><span style="font-size: 10.5pt">文件已经成功上传,是否继续添加……<BR>
<%
response.write file.FilePath&file.FileName&" ("&cint(file.FileSize/1024)&"K) 上传 成功!<br>"
%> </span></p>
<P><P align="center"><A HREF="javascript:window.close()"><span style="font-size: 10.5pt">关闭窗口</span></A></TD>
</TR>
</table>
</center>
</div>
<%
set file=nothing
set upload=nothing ''删除此对象
%>

[ 本帖最后由 cxv818 于 2010-8-24 21:21 编辑 ]
1 回复
#2
gupiao1752010-08-24 14:11
从2003 迁移到 2008什么意思?
1