上传图片问题。急!Server 对象 错误 'ASP 0177 : 800401f3'
禁用F3 2006-06-02 05:48:40 我的网站点上传的时候提示
Server 对象 错误 'ASP 0177 : 800401f3'
Server.CreateObject 失败
/51lrmanage/Inc/UPLOAD_IMG.ASP,行 32
800401f3
upload_img.asp 代码是。红色是32行
<!--#include file = "../Inc/lib.asp" -->
<!--#include file = "../Inc/Imglib.asp" -->
<%
function GetExtendName(FileName)
dim ExtName
I = InstrRev(FileName,".")
ExtName = Right(FileName,len(FileName)-I)
GetExtendName = ExtName
end function
function GetMainName(FileName)
dim MainName
'Response.Write FileName
'Response.End
I = InstrRev(FileName,".")
MainName = Left(FileName,I-1)
GetMainName = MainName
end function
iname = Request.QueryString("iname")
if iName="" then
call MsgBox("将保存的相对路径名称不能为空",1)
End If
If Request.ServerVariables("REQUEST_METHOD") = "POST" and Request.QueryString("type")<>"" Then
'Response.End
call CreateDIR(Application("ProductIMG"))
'UpLoadFileName = file.FileName
Set Fs = Server.CreateObject("scripting.filesystemobject")
Set objUpload = Server.CreateObject("aspcn.upload")
ImgDirectory = Server.MapPath(Application("ProductIMG"))
nstr = Cstr(NowFlag)
SavedFileName = nstr & ".jpg"
smallFileName = nstr & "_small.jpg"
bigFileName = nstr & "_big.jpg"
TempFileName = nstr & ".tmp"
Tfile = server.MapPath(Application("ProductIMG")& TempFileName)
ufile = server.MapPath(Application("ProductIMG")& SavedFileName)
sfile = server.MapPath(Application("ProductIMG")& smallFileName)
bfile = server.MapPath(Application("ProductIMG")& bigFileName)
objupload.maxsize = 100000000 '设定文件最大长度不超过100K,默认值为100K
objupload.overwrite = 2 '设定如果目标文件存在,进行覆盖,默认为1,表示不能覆盖
objupload.path = ImgDirectory '设定上传到服务器的路径,这里必须为绝对路径,默认值为c:\
objupload.uptofile = 1 '设置为上传后保存为文件
objUpload.NewFileName = TempFileName
varResult = objUpload.Upload '调用upload方法将文件保存
'ExtName = GetExtendName(objupload.filename("Img"))
If varResult<>"OK" Then '如果varResult返回OK,则文件上载成功
Call Msgbox("上传失败!",1)
End If
'这里处理图片的大小.如果是小图的话,就处理,如果是大图的话,就不处理.
SImg = Tfile
DImg = ufile
smallImgWidth = Application("ImgSmallWidth")
smallImgHeight= Application("ImgSmallHeight")
BigImgWidth = Application("ImgBigWidth")
BigImgHeight= Application("ImgBigHeight")
'If Lcase(iName) = "big_pic" then
'Call ProcessImg(SImg,bfile,bigImgWidth,bigImgHeight)
'End IF
Call ProcessImg(SImg,sfile,smallImgWidth,smallImgHeight) '小图
Call ProcessImg(SImg,bfile,bigImgWidth,bigImgHeight) '大图
'Call ProcessImg(SImg,DImg,Application("ImgBigWidth"),Application("ImgBigHeight")) '巨图
Call Fs.CopyFile(SImg,DImg)
Call delFile(Application("ProductIMG")& TempFileName)
'Call delVFile(SImg)
set objUpload = nothing
Set Fs = nothing
NewsID = Trim(Session("newsID"))
Filelink = Application("ProductIMG") & SavedFileName
'FileName = UpLoadFileName
FileName = SavedFileName
%>
<script language="javascript">
alert("成功上传文件<%=UploadFileName%>");
<%If Lcase(iName) = "big_pic" then%>
//parent.document.form1.small_pic.value = '<%=Application("ProductIMG") & smallFileName%>';
<%End If%>
parent.document.form1.small_pic.value = '<%=Application("ProductIMG") & smallFileName%>';
parent.document.form1.big_pic.value = '<%=Application("ProductIMG") & bigFileName%>';
parent.document.form1.<%=iname%>.value = '<%=FileLink%>';
//parent.document.all.previewphoto.src = '<%=FileLink%>';
//parent.document.all.previewphoto.src = '<%=Application("ProductIMG") & bigFileName%>';
//alert(parent.document.form1.<%=iname%>.value);
history.back();
</script>
<%
Response.End
end if
%>
<body topmargin=0 leftmargin=0 bgcolor=#EFEFEF>
<table border=0 width=100% cellpadding=1 cellspacing=0 height=100%>
<FORM action="UPLOAD_IMG.ASP?type=save&iname=<%=iname%>" id=form2 method=post name=form2 enctype="multipart/form-data" target="_self">
<tr><td align=left><input type=file size="9" name="UploadImg" class=stinput>
<input type=submit class=stinput value="上传" id=button1 name="supload">
</td></tr>
</form></table>