主题:  上传图片问题

zzist

职务:普通成员
等级:1
金币:0.0
发贴:31
#12005/7/9 10:16:37
错误提示:
Microsoft VBScript 编译器错误 错误 '800a03f6'

缺少 'End'

/iisHelp/common/500-100.asp,行242

服务器对象 错误 'ASP 0177 : 800401f3'

Server.CreateObject 失败

/Inc/UPLOAD_IMG.ASP,行40

无效的 ProgID。 若要获取关于此消息的更多的信息,请访问 Microsoft 联机支持站点: www.microsoft.com/contentredirect.asp

UPLOAD_IMG.ASP源码如下:

<!--#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("iname"
uploadForm = request("uploadForm"

if iName="" then
    call MsgBox("将保存的相对路径名称不能为空",1)
End If

FoldPath = Request("FoldPath"
if FoldPath ="" then
    call MsgBox("保存图片的相对路径不能为空!",1)
    
End If

If Request.ServerVariables("REQUEST_METHOD" = "POST" and Request.QueryString("type"<>"" Then
    'Response.End
    'UpLoadFileName = file.FileName
    CreateDIR(FoldPath)
    
    Set Fs         = Server.CreateObject("scripting.filesystemobject"
    Set objUpload = Server.CreateObject("aspcn.upload" 这里提示错误
    ImgDirectory = Server.MapPath(FoldPath)

    SavedFileName     = Session("UserName" & Cstr(NowFlag) & ".jpg" '& GetExtendName(UpLoadFileName)
    TempFileName     = Session("UserName" & Cstr(NowFlag) & ".tmp"
    
    Tfile = server.MapPath(FoldPath & TempFileName)
    ufile = server.MapPath(FoldPath & SavedFileName)

    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
    
     'ImgWidth = Application("ImgSmallWidth"
     'ImgHeight= Application("ImgSmallHeight"

     Call Fs.CopyFile(SImg,DImg) '拷贝到新文件
     Call delFile( FoldPath & TempFileName)'删除旧文件
     'Call delVFile(SImg)

     set objUpload = nothing
     Set Fs        = nothing

     'NewsID     = Trim(Session("newsID")
     Filelink     = FoldPath & SavedFileName
     'FileName     = UpLoadFileName
     FileName     = SavedFileName
    %>    
     <script language="javascript">
     alert("成功上传文件<%=UploadFileName%>";
     parent.document.<%=uploadForm%>.<%=iname%>.value = '<%=FileLink%>';
     //alert(parent.document.form1.<%=iname%>.value);
     history.back();
     </script>
    <%
Response.End
end if
%>

<style type="text/css">
A:visited {COLOR: #000000; TEXT-DECORATION: none}
A:active {COLOR: #000000; TEXT-DECORATION: none}
A:link {COLOR: #000000; TEXT-DECORATION: none}
A:hover {COLOR: #ff6600; text-deroration: none}
.text
{
FONT-SIZE: 9pt
COLOR: #000000;
FONT-FAMILY: 宋体;
TEXT-DECORATION: none
}
TABLE,td {FONT-SIZE: 9pt}

.stinput
{    BORDER-TOP-WIDTH: 1px;
    PADDING-RIGHT: 1px;
    PADDING-LEFT: 1px;
    BORDER-LEFT-WIDTH: 1px;
    FONT-SIZE: 9pt;
    BORDER-LEFT-COLOR: #cccccc;
    BORDER-BOTTOM-WIDTH: 1px;
    BORDER-BOTTOM-COLOR: #cccccc;
    PADDING-BOTTOM: 1px;
    BORDER-TOP-COLOR: #cccccc;
    PADDING-TOP: 1px;
    BORDER-RIGHT-WIDTH: 1px;
    BORDER-RIGHT-COLOR: #cccccc;
    HEIGHT: 20px;
    FONT-FAMILY: 宋体;
}

.stinput_1
{    
    FONT-SIZE: 9pt;
    HEIGHT: 20px;
    FONT-FAMILY: 宋体;
}
</style>

<body topmargin=0 leftmargin=0 bgcolor=#EFEFEF>

<table border=0 width=100% cellpadding=1 cellspacing=0 height=100% ID="Table1">
<FORM action="UPLOAD_IMG.ASP?type=save&Iname=<%=IName%>&UploadForm=<%=UploadForm%>&FoldPath=<%=FoldPath%>" id=form2 method=post name=form2 enctype="multipart/form-data" target="_self">
<tr><td align=left><input type=file size="25" name="file1" class=stinput ID="File1">
<input type=submit class=stinput value="上传" id=button1 name="supload">
</td></tr>
</form></table>



浮尘

职务:普通成员
等级:3
金币:7.0
发贴:1258
#22005/7/10 11:24:20
应该是你的服务器不支持FSO操作吧



DavidPP

职务:普通成员
等级:1
金币:0.0
发贴:5
#32005/7/11 21:57:56
服务器上没有安装那个上传组件哦