-- 作者:zhineng28
-- 发布时间:11/15/2005 9:22:00 AM
-- 文件上传程序请教
大虾们,下面是书上一道asp文件上传例题。可是运行的时候就是有错, 错误类型: Server 对象, ASP 0177 (0x800401F3) 无效的类别字符串 /charpter/chapter11/11-4.asp, 第 11 行 这个例题是分开两个页面来做的,代码如下: 页面11-3.asp: <html> <head> <title> 上传一个文件示例</title> </head> <body> <H2 align="center">上传一个文件</H2> <center> <form action="11-4.asp" method="post" enctype="multipart/form-data" > 选择文件:<input type="file" name="upfile"><br> 文件说明:<input type="text" name="intro" size="30"><br> 作者姓名:<input type="text" name="author" size="30"><br> <input type="submit" value=" 确定 "> </form> </center> </body> </html> 页面11-4.asp: <% Option Explicit %> <html> <head> <title>上传一个文件示例</title> </head> <body> <H2 align="center">文件已安全上传</H2> <center> <% Dim Upload '声明一个变量 Set Upload = Server.CreateObject("Persits.Upload.1") '上面就是创建一个文件上传组件实例,出现问题的就是这一行,我对照了书本很多次了,书本上就是这样写的。 Upload.SetMaxSize 2*1024*1024,False '限制文件不超过2M,否则截断 Upload.OverwriteFiles=True 'True表示可以覆盖 Upload.Save "C:\inetpub\wwwroot\asptemp\chapter11\upload" '上传到指定文件夹,路径是存在的 Response.Write "上传文件为:" & Upload.Files("upfile").Path & "<BR>" Response.Write "文件大小为:" & Upload.Files("upfile").Size & "字节<BR>" Response.Write "文件说明为:" & Upload.Form("intro").value & "<BR>" Response.Write "作者姓名为:" & Upload.Form("author").value & "<BR>" %> </center> </body> </html> 只要在11-3.asp页面中提交以后跳到页面11-4.asp就会显示下面的错误: Server 对象, ASP 0177 (0x800401F3) 无效的类别字符串 /charpter/chapter11/11-4.asp, 第 11 行 'Set Upload = Server.CreateObject("Persits.Upload.1") 我能确定的是,路径是存在的 请大虾们帮我看看上面的题目,错误的那一行错在什么地方?
|