当前位置:编程学习 > C#/ASP.NET >>

不用组件上传文件时提示出错!!等待中....

不用组件上传文件时提示出错,在objStream.LoadFromFile  strFileName '载入传过来的文件  语句出错,提示为:ADODB.Stream 错误 '800a0bba' 

文件无法被打开。 

/upload.asp,行 24 
其中strfilename参数值为C:\Documents and Settings\Administrator\桌面\12\321\ddd.xlsD

<html>

<head>
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>文件上传</title>
</head>
<body>
<%
Function GetFileName(ByVal strFile)
If strFile <> "" Then
GetFileName = mid(strFile,InStrRev(strFile, "\")+1)
Else
GetFileName = ""
End If
End function

strFileName = Request.Form("file") '取得上传的文件
Set objStream = Server.CreateObject("ADODB.Stream") '建立上传对像
objStream.Type = 1 '类型设定 1 代表上传
objStream.Open '打开
'response.write strFileName
objStream.LoadFromFile  strFileName '载入传过来的文件   
'response.write Server.MapPath(".") & "\TempletTable.xls"
objStream.SaveToFile Server.MapPath(".") & "\TempletTable.xls",2 '保存载入的文件
objStream.Close '关闭
response.write "文件上传成功!"
%>
</body>
</html> --------------------编程问答-------------------- 其中strfilename参数值应该为C:\Documents and Settings\Administrator\桌面\12\321\ddd.xls --------------------编程问答-------------------- 顶一下。。。。
补充:.NET技术 ,  ASP.NET
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,