Ir para conteúdo

POWERED BY:

Arquivado

Este tópico foi arquivado e está fechado para novas respostas.

lbf66

Microsoft VBScript runtime error '800a01a8'

Recommended Posts

Boa noite pessoal precisava de uma ajuda com esse código tava funcionando perfeitamente mas depois que meu provedor atualizaou o servidor está dando esse erro.



Microsoft VBScript runtime error '800a01a8'


Objeto necessário: 'Item (...)'


/adm/adicionar_imovel-asp.asp, linha 21




Segue o código:


'Response.BinaryWrite(Request.BinaryRead(Request.TotalBytes))

byteCount = Request.TotalBytes

'Response.BinaryWrite(Request.BinaryRead(varByteCount))


RequestBin = Request.BinaryRead(byteCount)

Dim UploadRequest

Set UploadRequest = CreateObject("Scripting.Dictionary")


BuildUploadRequest RequestBin


contentType = UploadRequest.Item("blob").Item("ContentType")

filepathname = UploadRequest.Item("blob").Item("FileName")

filename = Right(filepathname,Len(filepathname)-InstrRev(filepathname,"\"))

value = UploadRequest.Item("blob").Item("Value")


If Not (filename = "" or IsNull(filename)) Then


'Create FileSytemObject Component

Set ScriptObject = Server.CreateObject("Scripting.FileSystemObject")




'Create and Write to a File

pathEnd = Len(Server.mappath(Request.ServerVariables("PATH_INFO")))-14

' Set MyFile = ScriptObject.CreateTextFile("\upload\"&filename)

Set MyFile = ScriptObject.CreateTextFile("E:\Inetpub\vhosts\cajamarimoveis.com.br\httpdocs\imagens\imoveis\"&filename)

For i = 1 to LenB(value)

MyFile.Write chr(AscB(MidB(value,i,1)))

Next


MyFile.Close


End If


'Imagem G 01

contentType = UploadRequest.Item("blob01").Item("ContentType")

filepathname01 = UploadRequest.Item("blob01").Item("FileName")

filename01 = Right(filepathname01,Len(filepathname01)-InstrRev(filepathname01,"\"))

value = UploadRequest.Item("blob01").Item("Value")


If Not (filename01 = "" or IsNull(filename01)) Then


'Create FileSytemObject Component

Set ScriptObject = Server.CreateObject("Scripting.FileSystemObject")


'Create and Write to a File

pathEnd01 = Len(Server.mappath(Request.ServerVariables("PATH_INFO")))-14

' Set MyFile = ScriptObject.CreateTextFile("\upload\"&filename)

Set MyFile = ScriptObject.CreateTextFile("E:\Inetpub\vhosts\cajamarimoveis.com.br\httpdocs\imagens\imoveis\"&filename01)

For i = 1 to LenB(value)

MyFile.Write chr(AscB(MidB(value,i,1)))

Next


MyFile.Close


End If



'Imagem G 02

contentType = UploadRequest.Item("blob02").Item("ContentType")

filepathname02 = UploadRequest.Item("blob02").Item("FileName")

filename02 = Right(filepathname02,Len(filepathname02)-InstrRev(filepathname02,"\"))

value = UploadRequest.Item("blob02").Item("Value")


If Not (filename02 = "" or IsNull(filename02)) Then


'Create FileSytemObject Component

Set ScriptObject = Server.CreateObject("Scripting.FileSystemObject")


'Create and Write to a File

pathEnd02 = Len(Server.mappath(Request.ServerVariables("PATH_INFO")))-14

' Set MyFile = ScriptObject.CreateTextFile("\upload\"&filename)

Set MyFile = ScriptObject.CreateTextFile("E:\Inetpub\vhosts\cajamarimoveis.com.br\httpdocs\imagens\imoveis\"&filename02)

For i = 1 to LenB(value)

MyFile.Write chr(AscB(MidB(value,i,1)))

Next


MyFile.Close


End If



'Imagem G 03

contentType = UploadRequest.Item("blob03").Item("ContentType")

filepathname03 = UploadRequest.Item("blob03").Item("FileName")

filename03 = Right(filepathname03,Len(filepathname03)-InstrRev(filepathname03,"\"))

value = UploadRequest.Item("blob03").Item("Value")


If Not (filename03 = "" or IsNull(filename03)) Then


'Create FileSytemObject Component

Set ScriptObject = Server.CreateObject("Scripting.FileSystemObject")


'Create and Write to a File

pathEnd03 = Len(Server.mappath(Request.ServerVariables("PATH_INFO")))-14

' Set MyFile = ScriptObject.CreateTextFile("\upload\"&filename)

Set MyFile = ScriptObject.CreateTextFile("E:\Inetpub\vhosts\cajamarimoveis.com.br\httpdocs\imagens\imoveis\"&filename03)

For i = 1 to LenB(value)

MyFile.Write chr(AscB(MidB(value,i,1)))

Next


MyFile.Close


End If



'Imagem G 04

contentType = UploadRequest.Item("blob04").Item("ContentType")

filepathname04 = UploadRequest.Item("blob04").Item("FileName")

filename04 = Right(filepathname04,Len(filepathname04)-InstrRev(filepathname04,"\"))

value = UploadRequest.Item("blob04").Item("Value")


If Not (filename04 = "" or IsNull(filename04)) Then


'Create FileSytemObject Component

Set ScriptObject = Server.CreateObject("Scripting.FileSystemObject")


'Create and Write to a File

pathEnd04 = Len(Server.mappath(Request.ServerVariables("PATH_INFO")))-14

' Set MyFile = ScriptObject.CreateTextFile("\upload\"&filename)

Set MyFile = ScriptObject.CreateTextFile("E:\Inetpub\vhosts\cajamarimoveis.com.br\httpdocs\imagens\imoveis\"&filename04)

For i = 1 to LenB(value)

MyFile.Write chr(AscB(MidB(value,i,1)))

Next


MyFile.Close


End If


'Imagem G 05

contentType = UploadRequest.Item("blob05").Item("ContentType")

filepathname05 = UploadRequest.Item("blob05").Item("FileName")

filename05 = Right(filepathname05,Len(filepathname05)-InstrRev(filepathname05,"\"))

value = UploadRequest.Item("blob05").Item("Value")


If Not (filename05 = "" or IsNull(filename05)) Then


'Create FileSytemObject Component

Set ScriptObject = Server.CreateObject("Scripting.FileSystemObject")


'Create and Write to a File

pathEnd05 = Len(Server.mappath(Request.ServerVariables("PATH_INFO")))-14

' Set MyFile = ScriptObject.CreateTextFile("\upload\"&filename)

Set MyFile = ScriptObject.CreateTextFile("E:\Inetpub\vhosts\cajamarimoveis.com.br\httpdocs\imagens\imoveis\"&filename05)

For i = 1 to LenB(value)

MyFile.Write chr(AscB(MidB(value,i,1)))

Next


MyFile.Close



End If


'Imagem G 06

contentType = UploadRequest.Item("blob06").Item("ContentType")

filepathname06 = UploadRequest.Item("blob06").Item("FileName")

filename06 = Right(filepathname06,Len(filepathname06)-InstrRev(filepathname06,"\"))

value = UploadRequest.Item("blob06").Item("Value")


If Not (filename06 = "" or IsNull(filename05)) Then


'Create FileSytemObject Component

Set ScriptObject = Server.CreateObject("Scripting.FileSystemObject")


'Create and Write to a File

pathEnd05 = Len(Server.mappath(Request.ServerVariables("PATH_INFO")))-14

' Set MyFile = ScriptObject.CreateTextFile("\upload\"&filename)

Set MyFile = ScriptObject.CreateTextFile("E:\Inetpub\vhosts\cajamarimoveis.com.br\httpdocs\imagens\imoveis\"&filename06)

For i = 1 to LenB(value)

MyFile.Write chr(AscB(MidB(value,i,1)))

Next


MyFile.Close


End If


'Imagem G 07

contentType = UploadRequest.Item("blob07").Item("ContentType")

filepathname07 = UploadRequest.Item("blob07").Item("FileName")

filename07 = Right(filepathname07,Len(filepathname07)-InstrRev(filepathname07,"\"))

value = UploadRequest.Item("blob07").Item("Value")


If Not (filename07 = "" or IsNull(filename07)) Then


'Create FileSytemObject Component

Set ScriptObject = Server.CreateObject("Scripting.FileSystemObject")


'Create and Write to a File

pathEnd05 = Len(Server.mappath(Request.ServerVariables("PATH_INFO")))-14

' Set MyFile = ScriptObject.CreateTextFile("\upload\"&filename)

Set MyFile = ScriptObject.CreateTextFile("E:\Inetpub\vhosts\cajamarimoveis.com.br\httpdocs\imagens\imoveis\"&filename07)

For i = 1 to LenB(value)

MyFile.Write chr(AscB(MidB(value,i,1)))

Next


MyFile.Close


End If


'Imagem G 08

contentType = UploadRequest.Item("blob08").Item("ContentType")

filepathname08 = UploadRequest.Item("blob08").Item("FileName")

filename08 = Right(filepathname08,Len(filepathname08)-InstrRev(filepathname08,"\"))

value = UploadRequest.Item("blob08").Item("Value")


If Not (filename08 = "" or IsNull(filename08)) Then


'Create FileSytemObject Component

Set ScriptObject = Server.CreateObject("Scripting.FileSystemObject")


'Create and Write to a File

pathEnd05 = Len(Server.mappath(Request.ServerVariables("PATH_INFO")))-14

' Set MyFile = ScriptObject.CreateTextFile("\upload\"&filename)

Set MyFile = ScriptObject.CreateTextFile("E:\Inetpub\vhosts\cajamarimoveis.com.br\httpdocs\imagens\imoveis\"&filename08)

For i = 1 to LenB(value)

MyFile.Write chr(AscB(MidB(value,i,1)))

Next


MyFile.Close


End If



%>


<%

categoria = UploadRequest.Item("categoria").Item("Value")

tipo = UploadRequest.Item("tipo").Item("Value")

cidade = UploadRequest.Item("cidade").Item("Value")


imagem_p = filename


valor = Trim(UploadRequest.Item("valor").Item("Value"))


'definindo valor_media de acordo com categoria e preço do imóvel



If categoria = "para alugar" then


If (int(valor) > 20000 and int(valor) < 40000) then

valor_media = "R$ 200,00 à 400,00"

ElseIf (int(valor) > 40100 and int(valor) < 60000) then

valor_media = "R$ 400,00 à 600,00"

ElseIf (int(valor) > 60100 and int(valor) < 80000) then

valor_media = "R$ 600,00 à 800,00"

ElseIf (int(valor) > 80100 and int(valor) < 100000) then

valor_media = "R$ 800,00 à 1.000,00"

ElseIf (int(valor) > 10100 and int(valor) < 120000) then

valor_media = "R$ 1.000,00 à 1.200,00"

Else

valor_media = "Acima de R$ 1.200,00"

End If


End If


'Response.Write "Valor: " & int(valor) & "<BR>"

'Response.Write "Valor Media: " & valor_media

'Response.End




'fim de definição da variavel valor_media




imagem_g01 = filename01

imagem_g02 = filename02

imagem_g03 = filename03

imagem_g04 = filename04

imagem_g05 = filename05

imagem_g06 = filename06

imagem_g07 = filename07

imagem_g08 = filename08




destaque = UploadRequest.Item("destaque").Item("Value")

If destaque = "n" then

destaque = 0

Else

destaque = 1

End If


descricao = Trim(UploadRequest.Item("descricao").Item("Value"))

data_cadastro = Date



Conecta()

SQL = "Insert Into IMOVEIS (CATEGORIA, TIPO, CIDADE, VALOR, VALOR_MEDIA, DESCRICAO, IMAGEM_P, IMAGEM_G01, IMAGEM_G02, IMAGEM_G03, IMAGEM_G04, IMAGEM_G05, IMAGEM_G06, IMAGEM_G07, IMAGEM_G08, DATA_CADASTRO, DESTAQUE) Values ('" & categoria & "', '" & tipo & "', '" & cidade & "', '" & valor & "', '" & valor_media & "', '" & descricao & "', '" & imagem_p & "', '" & imagem_g01 & "', '" & imagem_g02 & "', '" & imagem_g03 & "', '" & imagem_g04 & "', '" & imagem_g05 & "', '" & imagem_g06 & "', '" & imagem_g07 & "', '" & imagem_g08 & "', '" & data_cadastro & "', '" & destaque & "')"

AbreRecordSet(SQL)


%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>

<head>

<title>Cajamar Imóveis</title>

<SCRIPT LANGUAGE="JavaScript" src="mask.js">

</script>

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

<link href="estilocajamar.css" rel="stylesheet" type="text/css">

<style type="text/css">

<!--

.style1 {font-size: 18px;

color: #FFFFFF;

}

.style3 {font-size: 18px}

.style4 {color: #FFFFFF}

-->

</style>

</head>


<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">

<table width="100%" border="0" cellspacing="0" cellpadding="0">

<tr align="center" valign="middle" background="fundo_banner.jpg">

<td height="160" background="../imgs2012/fundo_banner.jpg"><table width="1024" border="0" cellspacing="0" cellpadding="0">

<tr>

<td width="340" height="132" align="center" valign="middle"> </td>

<td width="340" align="center" valign="middle"><img src="../imgs2012/logosite.gif" width="112" height="125"></td>

<td width="341" align="center" valign="middle"> </td>

</tr>

<tr>

<td colspan="3"><table width="1024" border="0" cellspacing="0" cellpadding="0">

<tr>

<td width="121" align="left" valign="baseline"><a href="adicionar_imovel.asp"><img src="imgs_adm/incluir_imoveis.gif" width="117" height="28" border="0"></a></td>

<td width="119" align="left" valign="baseline"><a href="adicionar_dica.asp"><img src="imgs_adm/incluir_dicas.gif" width="117" height="28" border="0"></a><a href="alterar_imovel.asp"></a></td>

<td width="122" align="left" valign="baseline"><a href="adicionar_noticias.asp"><img src="imgs_adm/incluir_novidades.gif" width="117" height="28" border="0"></a><a href="adicionar_dica.asp"></a></td>

<td width="286" align="center" valign="middle"><strong><font color="#000000" size="4" face="Arial, Helvetica, sans-serif">Sistema

Administrativo</font></strong></td>

<td width="120" align="left" valign="baseline"><a href="adicionar_cidade.asp"><img src="imgs_adm/incluir_cidades.gif" width="117" height="28" border="0"></a><a href="adicionar_noticias.asp"></a></td>

<td width="119" align="left" valign="baseline"><img src="imgs_adm/incluir_servicos.gif" width="117" height="28"></td>

<td width="123" align="left" valign="baseline"><img src="imgs_adm/incluir_links.gif" width="117" height="28"></td>

</tr>

</table></td>

</tr>

</table></td>

</tr>

<tr>

<td height="2" bgcolor="#336600"></td>

</tr>

<tr>

<td height="40"> </td>

</tr>

<tr>

<td align="center"><table width="1024" border="0" align="center" cellpadding="0" cellspacing="0">

<tr>

<td width="1" height="30" rowspan="3" align="center" bgcolor="#000000"></td>

<td height="1" align="center" bgcolor="#000000"></td>

<td width="1" rowspan="3" align="center" bgcolor="#000000"></td>

</tr>

<tr>

<td height="30" align="center" valign="middle" bgcolor="#FF0000" class="txt11 style3 style4 style1">Imóvel adicionado com sucesso!! </td>

</tr>

<tr>

<td height="1" align="center" bgcolor="#000000"></td>

</tr>

</table></td>

</tr>


<tr>

<td align="center"><table width="778" border="0" cellspacing="0" cellpadding="0">

<tr>

<td width="778" height="1" align="left" valign="top"></td>

</tr>


<tr>

<td align="left" valign="top" bgcolor="#EAEAEA"><table width="1024" border="0" cellpadding="0" cellspacing="0">

<tr valign="top">

<td height="500" valign="top" bgcolor="#EAEAEA"><table width="1024" border="0" cellpadding="0" cellspacing="0">


<tr>

<td height="20" colspan="2" align="left" valign="top" bgcolor="#EAEAEA"></td>

</tr>

<tr>

<td height="3" colspan="2" align="left" valign="top" bgcolor="#EAEAEA"></td>

</tr>

<tr>

<td width="10" align="left" valign="top" bgcolor="#EAEAEA" class="txt11"> </td>

<td align="left" valign="top" bgcolor="#EAEAEA" class="txt11"><p><strong>Você adicionou um imóvel ao banco de dados!!!</strong></p>

<p>Confira abaixo os dados cadastrados:</p>

<p><strong>Categoria: </strong>

<% = categoria%>

<strong><br>

Tipo: </strong>

<% = tipo%>

<strong></strong><strong><br>

Valor: </strong>

<% = valor%>

<strong></strong><strong><br>

Descrição: </strong>

<% = descricao%>

<br>

<b>Valor Média:</b> <%=valor_media%></p>

<p>Para adicionar outro imóvel, <a href="adicionar_imovel.asp">Clique

aqui.</a></p>

<%

FechaRecordSet()

If Not (filename = "" or IsNull(filename)) Then

%>

<!--#include file="upload/upload.asp"-->

<%

End If

%> </td>

</tr>

<tr>

<td height="5" colspan="2" align="left" valign="top" bgcolor="#EAEAEA"></td>

</tr>

</table></td>

</tr>

</table></td>

</tr>

<tr>

<td height="1" align="left" valign="top"></td>

</tr>



</table></td>

Compartilhar este post


Link para o post
Compartilhar em outros sites

×

Informação importante

Ao usar o fórum, você concorda com nossos Termos e condições.