打印

求助!三亚摄影网站后台上传图片出错!

求助!三亚摄影网站后台上传图片出错!

谢谢各位高人看看是怎么回事:
出错:
Microsoft VBScript 运行时错误 '800a000d'
类型不匹配: 'PureUploadSetup'
\admin_xiangce_uppic.asp, line 55

代码:

<[email=%@LANGUAGE=]%@LANGUAGE="VBSCRIPT[/email]" CODEPAGE="936"%>
<%
' *** Logout the current user.
MM_Logout = CStr(Request.ServerVariables("URL")) & "?MM_Logoutnow=1"
If (CStr(Request("MM_Logoutnow")) = "1") Then
  Session.Contents.Remove("MM_Username")
  Session.Contents.Remove("MM_UserAuthorization")
  MM_logoutRedirectPage = "index.html"
  ' redirect with URL parameters (remove the "MM_Logoutnow" query param).
  if (MM_logoutRedirectPage = "") Then MM_logoutRedirectPage = CStr(Request.ServerVariables("URL"))
  If (InStr(1, UC_redirectPage, "?", vbTextCompare) = 0 And Request.QueryString <> "") Then
    MM_newQS = "?"
    For Each Item In Request.QueryString
      If (Item <> "MM_Logoutnow") Then
        If (Len(MM_newQS) > 1) Then MM_newQS = MM_newQS & "&"
        MM_newQS = MM_newQS & Item & "=" & Server.URLencode(Request.QueryString(Item))
      End If
    Next
    if (Len(MM_newQS) > 1) Then MM_logoutRedirectPage = MM_logoutRedirectPage & MM_newQS
  End If
  Response.Redirect(MM_logoutRedirectPage)
End If
%>
<%
' *** Restrict Access To Page: Grant or deny access to this page
MM_authorizedUsers="ad11"
MM_authFailedURL="sorry.asp"
MM_grantAccess=false
If Session("MM_Username") <> "" Then
  If (false Or CStr(Session("MM_UserAuthorization"))="") Or _
         (InStr(1,MM_authorizedUsers,Session("MM_UserAuthorization"))>=1) Then
    MM_grantAccess = true
  End If
End If
If Not MM_grantAccess Then
  MM_qsChar = "?"
  If (InStr(1,MM_authFailedURL,"?") >= 1) Then MM_qsChar = "&"
  MM_referrer = Request.ServerVariables("URL")
  if (Len(Request.QueryString()) > 0) Then MM_referrer = MM_referrer & "?" & Request.QueryString()
  MM_authFailedURL = MM_authFailedURL & MM_qsChar & "accessdenied=" & Server.URLEncode(MM_referrer)
  Response.Redirect(MM_authFailedURL)
End If
%>
<!--#include file="Connections/conn.asp" -->
<!--#include file="ScriptLibrary/incPureUpload.asp" -->
<%
'*** Pure ASP File Upload -----------------------------------------------------
' Copyright (c) 2001-2002 George Petrov, www.UDzone.com
' Process the upload
' Version: 2.0.9
'------------------------------------------------------------------------------
'*** File Upload to: """pic""", Extensions: "GIF,JPG,JPEG,BMP,PNG", Form: form1, Redirect: "", "file", "100", "over", "true", "10", "10" , "800", "600", "width", "height", "600", "blueFlashProgress.htm", "300", "100"

Dim GP_redirectPage, RequestBin, UploadQueryString, GP_uploadAction, UploadRequest
PureUploadSetup

If (CStr(Request.QueryString("GP_upload")) <> "") Then
  on error resume next
  Dim reqPureUploadVersion, foundPureUploadVersion
  reqPureUploadVersion = 2.09
  foundPureUploadVersion = getPureUploadVersion()
  if err or reqPureUploadVersion > foundPureUploadVersion then
    Response.Write "<b>You don't have latest version of ScriptLibrary/incPureUpload.asp uploaded on the server.</b><br>"
    Response.Write "This library is required for the current page. It is fully backwards compatible so old pages will work as well.<br>"
    Response.End   
  end if
  on error goto 0
  GP_redirectPage = ""
  Server.ScriptTimeout = 600
  
  RequestBin = Request.BinaryRead(Request.TotalBytes)
  Set UploadRequest = CreateObject("Scripting.Dictionary")  
  BuildUploadRequest RequestBin, """pic""", "file", "100", "over"
  
  If (GP_redirectPage <> "" and not (CStr(UploadFormRequest("MM_insert")) <> "" or CStr(UploadFormRequest("MM_update")) <> "")) Then
    If (InStr(1, GP_redirectPage, "?", vbTextCompare) = 0 And UploadQueryString <> "") Then
      GP_redirectPage = GP_redirectPage & "?" & UploadQueryString
    End If
    Response.Redirect(GP_redirectPage)  
  end if  
else
  if UploadQueryString <> "" then
    UploadQueryString = UploadQueryString & "&GP_upload=true"
  else  
    UploadQueryString = "GP_upload=true"
  end if  
end if
' End Pure Upload
'------------------------------------------------------------------------------
%>
<%
' *** Edit Operations: (Modified for File Upload) declare variables

Dim MM_editAction
Dim MM_abortEdit
Dim MM_editQuery
Dim MM_editCmd

Dim MM_editConnection
Dim MM_editTable
Dim MM_editRedirectUrl
Dim MM_editColumn
Dim MM_recordId

Dim MM_fieldsStr
Dim MM_columnsStr
Dim MM_fields
Dim MM_columns
Dim MM_typeArray
Dim MM_formVal
Dim MM_delim
Dim MM_altVal
Dim MM_emptyVal
Dim MM_i

MM_editAction = CStr(Request.ServerVariables("SCRIPT_NAME"))
If (UploadQueryString <> "") Then
  MM_editAction = MM_editAction & "?" & Server.HTMLEncode(UploadQueryString)
End If

' boolean to abort record edit
MM_abortEdit = false

' query string to execute
MM_editQuery = ""
%>
<%
' *** Update Record: (Modified for File Upload) set variables

If (CStr(UploadFormRequest("MM_update")) = "form1" And CStr(UploadFormRequest("MM_recordId")) <> "") Then
  MM_editConnection = MM_conn_STRING
  MM_editTable = "zpzs"
  MM_editColumn = "ID"
  MM_recordId = "" + UploadFormRequest("MM_recordId") + ""
  MM_editRedirectUrl = "admin_zuopin_editok.asp"
  MM_fieldsStr  = "pic|value|width|value|height|value"
  MM_columnsStr = "pic|',none,''|width|',none,''|height|',none,''"

  ' create the MM_fields and MM_columns arrays
  MM_columnsStr = FixColumnsForUpload(MM_fieldsStr,MM_columnsStr)
  MM_fieldsStr = FixFieldsForUpload(MM_fieldsStr,MM_columnsStr)
  MM_fields = Split(MM_fieldsStr, "|")
  MM_columns = Split(MM_columnsStr, "|")
  
  ' set the form values
  For MM_i = LBound(MM_fields) To UBound(MM_fields) Step 2
    MM_fields(MM_i+1) = CStr(UploadFormRequest(MM_fields(MM_i)))
  Next

  ' append the query string to the redirect URL
  If (MM_editRedirectUrl <> "" And UploadQueryString <> "") Then
    If (InStr(1, MM_editRedirectUrl, "?", vbTextCompare) = 0 And UploadQueryString <> "") Then
      MM_editRedirectUrl = MM_editRedirectUrl & "?" & UploadQueryString
    Else
      MM_editRedirectUrl = MM_editRedirectUrl & "&" & UploadQueryString
    End If
  End If

End If
%>
<%
' *** Update Record: (Modified for File Upload) construct a sql update statement and execute it

If (CStr(UploadFormRequest("MM_update")) <> "" And CStr(UploadFormRequest("MM_recordId")) <> "") Then
  ' create the sql update statement
  MM_editQuery = "update " & MM_editTable & " set "
  For MM_i = LBound(MM_fields) To UBound(MM_fields) Step 2
    MM_formVal = MM_fields(MM_i+1)
    MM_typeArray = Split(MM_columns(MM_i+1),",")
    MM_delim = MM_typeArray(0)
    If (MM_delim = "none") Then MM_delim = ""
    MM_altVal = MM_typeArray(1)
    If (MM_altVal = "none") Then MM_altVal = ""
    MM_emptyVal = MM_typeArray(2)
    If (MM_emptyVal = "none") Then MM_emptyVal = ""
    If (MM_formVal = "") Then
      MM_formVal = MM_emptyVal
    Else
      If (MM_altVal <> "") Then
        MM_formVal = MM_altVal
      ElseIf (MM_delim = "'") Then  ' escape quotes
        MM_formVal = "'" & Replace(MM_formVal,"'","''") & "'"
      Else
        MM_formVal = MM_delim + MM_formVal + MM_delim
      End If
    End If
    If (MM_i <> LBound(MM_fields)) Then
      MM_editQuery = MM_editQuery & ","
    End If
    MM_editQuery = MM_editQuery & MM_columns(MM_i) & " = " & MM_formVal
  Next
  MM_editQuery = MM_editQuery & " where " & MM_editColumn & " = " & MM_recordId

  If (Not MM_abortEdit) Then
    ' execute the update
    Set MM_editCmd = Server.CreateObject("ADODB.Command")
    MM_editCmd.ActiveConnection = MM_editConnection
    MM_editCmd.CommandText = MM_editQuery
    MM_editCmd.Execute
    MM_editCmd.ActiveConnection.Close

    If (MM_editRedirectUrl <> "") Then
      Response.Redirect(MM_editRedirectUrl)
    End If
  End If

End If
%>
<%
Dim Recordset1__MMColParam
Recordset1__MMColParam = "1"
If (Request.QueryString("ID") <> "") Then
  Recordset1__MMColParam = Request.QueryString("ID")
End If
%>
<%
Dim Recordset1
Dim Recordset1_numRows

Set Recordset1 = Server.CreateObject("ADODB.Recordset")
Recordset1.ActiveConnection = MM_conn_STRING
Recordset1.Source = "SELECT * FROM zpzs WHERE ID = " + Replace(Recordset1__MMColParam, "'", "''") + ""
Recordset1.CursorType = 0
Recordset1.CursorLocation = 2
Recordset1.LockType = 1
Recordset1.Open()

Recordset1_numRows = 0
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<script language="JavaScript">
<!--

function checkFileUpload(form,extensions,requireUpload,sizeLimit,minWidth,minHeight,maxWidth,maxHeight,saveWidth,saveHeight) { //v2.09
  document.MM_returnValue = true;
  for (var i = 0; i<form.elements.length; i++) {
    field = form.elements;
    if (field.type.toUpperCase() != 'FILE') continue;
    checkOneFileUpload(field,extensions,requireUpload,sizeLimit,minWidth,minHeight,maxWidth,maxHeight,saveWidth,saveHeight);
} }

function checkOneFileUpload(field,extensions,requireUpload,sizeLimit,minWidth,minHeight,maxWidth,maxHeight,saveWidth,saveHeight) { //v2.09
  document.MM_returnValue = true;
  if (extensions != '') var re = new RegExp("\.(" + extensions.replace(/,/gi,"|").replace(/\s/gi,"") + ")$","i");
    if (field.value == '') {
      if (requireUpload) {alert('必须选择文件!');document.MM_returnValue = false;field.focus();return;}
    } else {
      if(extensions != '' && !re.test(field.value)) {
        alert('您选择的文件类型不能上传。\n支持上传的文件类型包括: ' + extensions + '.\n请选择正确的文件类型。');
        document.MM_returnValue = false;field.focus();return;
      }
    document.PU_uploadForm = field.form;
    re = new RegExp(".(gif|jpg|png|bmp|jpeg)$","i");
    if(re.test(field.value) && (sizeLimit != '' || minWidth != '' || minHeight != '' || maxWidth != '' || maxHeight != '' || saveWidth != '' || saveHeight != '')) {
      checkImageDimensions(field,sizeLimit,minWidth,minHeight,maxWidth,maxHeight,saveWidth,saveHeight);
    } }
}

function showImageDimensions(fieldImg) { //v2.09
  var isNS6 = (!document.all && document.getElementById ? true : false);
  var img = (fieldImg && !isNS6 ? fieldImg : this);
  if (img.width > 0 && img.height > 0) {
  if ((img.minWidth != '' && img.minWidth > img.width) || (img.minHeight != '' && img.minHeight > img.height)) {
    alert('上传的图片尺寸太小!\n最小应该为: ' + img.minWidth + ' x ' + img.minHeight); return;}
  if ((img.maxWidth != '' && img.width > img.maxWidth) || (img.maxHeight != '' && img.height > img.maxHeight)) {
    alert('上传的图片尺寸太大!\n最大应该为: ' + img.maxWidth + ' x ' + img.maxHeight); return;}
  if (img.sizeLimit != '' && img.fileSize > img.sizeLimit) {
    alert('上传的图片文件体积太大!\n最大应该为: ' + (img.sizeLimit/1024) + ' KB'); return;}
  if (img.saveWidth != '') document.PU_uploadForm[img.saveWidth].value = img.width;
  if (img.saveHeight != '') document.PU_uploadForm[img.saveHeight].value = img.height;
  document.MM_returnValue = true;
} }

function checkImageDimensions(field,sizeL,minW,minH,maxW,maxH,saveW,saveH) { //v2.09
  if (!document.layers) {
    var isNS6 = (!document.all && document.getElementById ? true : false);
    document.MM_returnValue = false; var imgURL = 'file:///' + field.value.replace(/\\/gi,'/').replace(/:/gi,'|').replace(/"/gi,'').replace(/^\//,'');
    if (!field.gp_img || (field.gp_img && field.gp_img.src != imgURL) || isNS6) {field.gp_img = new Image();
     with (field) {gp_img.sizeLimit = sizeL*1024; gp_img.minWidth = minW; gp_img.minHeight = minH; gp_img.maxWidth = maxW; gp_img.maxHeight = maxH;
      gp_img.saveWidth = saveW; gp_img.saveHeight = saveH; gp_img.onload = showImageDimensions; gp_img.src = imgURL; }
  } else showImageDimensions(field.gp_img);}
}

function showProgressWindow(progressFile,popWidth,popHeight) { //v2.09
  var showProgress = false, form, field;
  for (var f = 0; f<document.forms.length; f++) {
    form = document.forms[f];
    for (var i = 0; i<form.elements.length; i++) {
      field = form.elements;
      if (field.type.toUpperCase() != 'FILE') continue;
      if (field.value != '') {showProgress = true;break;}
  } }
  if (showProgress && document.MM_returnValue) {
    var w = 480, h = 340;
    if (document.all || document.layers || document.getElementById) {
      w = screen.availWidth; h = screen.availHeight;}
    var leftPos = (w-popWidth)/2, topPos = (h-popHeight)/2;
    document.progressWindow = window.open(progressFile,'ProgressWindow','toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no,width=' + popWidth + ',height='+popHeight);
    document.progressWindow.moveTo(leftPos, topPos);document.progressWindow.focus();
  window.onunload = function () {document.progressWindow.close();};
} }
//-->
</script>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>管理</title>
<style type="text/css">
<!--
body,td,th {
font-size: 12px;
}
body {
margin-top: 0px;
margin-bottom: 0px;
}
a:link {
text-decoration: none;
}
a:visited {
text-decoration: none;
}
a:hover {
text-decoration: underline;
}
a:active {
text-decoration: none;
}
.kuang {
border: 1px solid #0099CC;
}
.style2 {color: #333333}
.style3 {color: #FF0000}
-->
</style>
</head>

<body>
<table width="778" height="26" border="0" align="center" cellpadding="0" cellspacing="0" class="kuang">
  <tr>
    <td align="center" bgcolor="#F7F5F4"><table width="744" height="20" border="0" cellpadding="0" cellspacing="0">
      <tr>
        <td width="630" align="left">欢迎光临后台管理</td>
        <td width="114" align="left"><a href="<%= MM_Logout %>" class="style3">返回首页</a></td>
      </tr>
    </table></td>
  </tr>
</table>
<table width="778" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td><img src="images/01.gif" width="2" height="2"></td>
  </tr>
</table>
<table width="778" height="333" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td width="142" align="left" valign="top"><table width="140" height="367" border="0" align="left" cellpadding="0" cellspacing="0" class="kuang">
      <tr>
        <td height="365" valign="top"><table width="138" height="27" border="0" cellpadding="0">
            <tr>
              <td align="center" bgcolor="#CACACA">管理项目</td>
            </tr>
          </table>
            <table width="138" height="27" border="0" cellpadding="2">
              <tr>
                <td width="39" align="center" bgcolor="#F7F7F7"><img src="image/pot_10.gif" width="11" height="11"></td>
                <td width="93" align="left" bgcolor="#F7F7F7"><a href="admin_gydl.asp" class="style2">关于朵莉</a></td>
              </tr>
            </table>
            <table width="138" height="27" border="0" cellpadding="2">
              <tr>
                <td width="39" align="center" bgcolor="#F7F7F7"><img src="image/pot_10.gif" width="11" height="11"></td>
                <td width="93" align="left" bgcolor="#F7F7F7"> <a href="admin_news.asp" class="style2">活动新闻</a> </td>
              </tr>
            </table>
            <table width="138" height="27" border="0" cellpadding="2">
              <tr>
                <td width="39" align="center" bgcolor="#F7F7F7"><img src="image/pot_10.gif" width="11" height="11"></td>
                <td width="93" align="left" bgcolor="#F7F7F7"><a href="admin_xiangce.asp" class="style2">相册管理</a></td>
              </tr>
            </table>
            <table width="138" height="27" border="0" cellpadding="2">
              <tr>
                <td width="39" align="center" bgcolor="#F7F7F7"><img src="image/pot_10.gif" width="11" height="11"></td>
                <td width="93" align="left" bgcolor="#F7F7F7"><a href="admin_zuopin.asp" class="style2">作品管理</a></td>
              </tr>
            </table>
            <table width="138" height="27" border="0" cellpadding="2">
              <tr>
                <td width="39" align="center" bgcolor="#F7F7F7"><img src="image/pot_10.gif" width="11" height="11"></td>
                <td width="93" align="left" bgcolor="#F7F7F7"><a href="admin_pslc.asp" class="style2">拍摄流程</a></td>
              </tr>
            </table>
            <table width="138" height="27" border="0" cellpadding="2">
              <tr>
                <td width="39" align="center" bgcolor="#F7F7F7"><img src="image/pot_10.gif" width="11" height="11"></td>
                <td width="93" align="left" bgcolor="#F7F7F7"><a href="admin_baojia.asp" class="style2">服务报价</a></td>
              </tr>
            </table>
            <table width="138" height="27" border="0" cellpadding="2">
              <tr>
                <td width="39" align="center" bgcolor="#F7F7F7"><img src="image/pot_10.gif" width="11" height="11"></td>
                <td width="93" align="left" bgcolor="#F7F7F7"><a href="admin_liuyan.asp" class="style2">留言管理</a></td>
              </tr>
            </table>
            <table width="138" height="27" border="0" cellpadding="2">
              <tr>
                <td width="39" align="center" bgcolor="#F7F7F7"><img src="image/pot_10.gif" width="11" height="11"></td>
                <td width="93" align="left" bgcolor="#F7F7F7"><a href="admin_user.asp" class="style2">修改密码</a></td>
              </tr>
          </table></td>
      </tr>
    </table></td>
    <td width="636" align="right" valign="top"><table width="635" border="0" cellpadding="0" cellspacing="0" class="kuang">
      <tr>
        <td height="361" valign="top"><table width="635" border="0" cellpadding="0">
          <tr>
            <td height="24" align="left" bgcolor="#CECBCE">您现在的位置:管理中心首页 --&gt; 作品管理</td>
          </tr>
          <tr>
            <td height="334" align="center" valign="top"><table width="615" height="336" border="0" cellpadding="0" cellspacing="0">
              <tr>
                <td height="12"> </td>
              </tr>
              <tr>
                <td height="324" valign="top"><form action="<%=MM_editAction%>" method="POST" enctype="multipart/form-data" name="form1">
                    <table width="606" height="123" border="0" cellpadding="0" cellspacing="0">
                      <tr align="left" bgcolor="#F2F2F2">
                        <td height="33" colspan="2">上传相册图:</td>
                      </tr>
                      <tr align="left" bgcolor="#F2F2F2">
                        <td height="31" colspan="2">相册标题:<%=(Recordset1.Fields.Item("type").Value)%> &gt; <%=(Recordset1.Fields.Item("biaoti").Value)%> </td>
                      </tr>
                      <tr align="left" bgcolor="#F2F2F2">
                        <td height="29" colspan="2">选择图片:
                          <input name="pic" type="file" id="pic">
                          <input name="width" type="hidden" id="width">
                          <input name="height" type="hidden" id="height"></td>
                      </tr>
                      <tr bgcolor="#F2F2F2">
                        <td width="61"> </td>
                        <td width="545" height="30" align="left"><input type="submit" name="Submit2" value="确认上传"></td>
                      </tr>
                    </table>
               
                    <input type="hidden" name="MM_update" value="form1">
                    <input type="hidden" name="MM_recordId" value="<%= Recordset1.Fields.Item("ID").Value %>">
                </form></td>
              </tr>
            </table></td>
          </tr>
        </table></td>
      </tr>
    </table></td>
  </tr>
</table>
<table width="778" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td><img src="images/01.gif" width="2" height="2"></td>
  </tr>
</table>
<table width="778" height="72" border="0" align="center" cellpadding="0" cellspacing="0" class="kuang">
  <tr>
    <td height="34" align="center" bgcolor="#F7F5F4">www.netwei.com.cn 设计制作</td>
  </tr>
  <tr>
    <td height="36" align="center" bgcolor="#FFFFFF"> </td>
  </tr>
</table>
</body>
</html>
<%
Recordset1.Close()
Set Recordset1 = Nothing
%>
David Villa

TOP

没有调试过,不过说得很清楚啊,第55行PureUploadSetup是一个变量,试试放到上一行结尾,与前面用逗号隔开.

+1

评分总分

  • admin

TOP

谢谢!帮忙!!但还是有问题,我感觉是不是差组件!!!又出现
Microsoft VBScript 运行时错误 '800a000d'

类型不匹配: 'UploadFormRequest'

\admin_xiangce_uppic.asp, line 129
David Villa

TOP

组件的问题

+1

评分总分

  • admin

TOP

恩!谢谢回复!看来只有另外选个代码改了!
David Villa

TOP

关于我们  |   联系我们  |  广告服务  |  最新动态  |  版权声明  |  网站开发  |  人才招聘  |  友情链接  |  网站地图  |  RSS订阅服务
Powered by Discuz! 6.1.0 © 2001-2007 Comsenz Inc.
---------------------------------------------------------------------------------------
搜虎精品社区所有文章为会员所发布,会员拥有该内容的所有权力及责任,转载时请注明出处!
管理员:SouHo QQ:185951958(请直击主题),MSN:souho#live.com(#改为@) 其它非本人.
拒绝任何人以任何形式在搜虎精品社区发表与中华人民共和国法律相抵触的言论!
网站备案号:鲁ICP备07503818号 青岛市公安局网警支队专项备案号:37020020080578
法律顾问:于富律师(青岛)

Copyright 2007 - 2008 Souho.Net Corporation, All Rights Reserved!      Processed in 0.044116 second(s), 8 queries, Gzip enabled.