Ir para conteúdo

POWERED BY:

Arquivado

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

Paschoal Rizzo

Erro na inclusão com fotos

Recommended Posts

Olá amigos estou tentando gravar um veiculos ate ai td bem, seleciono td que ele tem, e se eu n colocar fotos ele grava no bando de dados, mais se eu coloco foto, ele na hora de gravar da pagina n pode ser exibida, se alguem puder me ajudar agradeço de coração

 

 

esse é o codigo

 

<!--#include file="../../config.inc"--><!--#include file="../aut.inc"--><!--#include file="../../db.inc"--><!--#include file="../../funcoes.inc"--><!--#INCLUDE FILE="../reusavel/upload.inc"--><%if Request.ServerVariables("REQUEST_METHOD") = "POST" then 	diretorio = root_central_upload & "/veiculo/"	'response.write diretorio	Set RS = Server.CreateObject("ADODB.RecordSet")	set Fields = GetUpload()	acao		= Fields("acao").Value.String	CodigoVeiculo	= Fields("CodigoVeiculo").Value.String	CodigoMarca		= Fields("CodigoMarca").Value.String	CodigoModelo	= Fields("CodigoModelo").Value.String	CodigoCor		= Fields("CodigoCor").Value.String	AnoFabricacao	= Fields("AnoFabricacao").Value.String	AnoModelo		= Fields("AnoModelo").Value.String	Combustivel		= Fields("Combustivel").Value.String	Placa			= Fields("Placa").Value.String	Preco			= Fields("Preco").Value.String	Km				= Fields("Km").Value.String	FotoPrincipal	= Fields("FotoPrincipal").FileName	Foto1			= Fields("Foto1").FileName	Foto2			= Fields("Foto2").FileName	Foto3			= Fields("Foto3").FileName	DataCadastro		= Fields("DataCadastro").Value.String	InformacoesAdicionais	= Fields("InformacoesAdicionais").Value.String	CodigoOpcional = request.querystring("CodigoOpcional")	if CodigoMarca = "" then		msg = "Selecione a Marca do Veículo!"	elseif CodigoModelo = "" then		msg = "Selecione o Modelo do Veículo!"	elseif CodigoCor = "" then		msg = "Selecione a Cor do Veículo!"	elseif Combustivel = "" then		msg = "Selecione o Tipo de Combustível do Veículo!"	elseif KM = "" then		msg = "Digite o quantidade de Kilomêtros Rodados do Veículo!"	elseif Placa = "" then		msg = "Digite o Último dígito da Placa do Veículo!"	elseif AnoFabricacao = "" then		msg = "Digite o ano de Fabricação do Veículo!"	elseif AnoModelo = "" then		msg = "Digite o ano do Modelo do Veículo!"	elseif Preco = "" then		msg = "Digite o valor de Venda do Veículo!"	end if	if FotoPrincipal			= "" then FotoPrincipal	= null	if Foto1					= "" then Foto1	= null	if Foto2					= "" then Foto2	= null	if Foto3					= "" then Foto3	= null	if DataCadastro				= "" then DataCadastro	= now	if InformacoesAdicionais	= "" then InformacoesAdicionais	= null	if CodigoOpcional	= "" then CodigoOpcional	= null	'Se a mensagem tiver algo	if msg <> "" then%>		<script>			alert("<%=msg%>");			history.go(-1);		</script>		<%response.end	end if	if acao = "alterar" then		SQL = "select * from Veiculos where CodigoVeiculo = " & CodigoVeiculo		RS.open SQL, Conn, 1, 3		if RS.eof then			msg = "Parâmetro informado inválido ou incoerente !"		end if	else		CodigoVeiculo = GeraId("Veiculos","CodigoVeiculo")		SQL = "select * from Veiculos where CodigoVeiculo = 0"		RS.open SQL, Conn, 1, 3	end if	if acao = "incluir" then		msgalert = "Inclusão"		RS.Addnew		RS("CodigoVeiculo") = CodigoVeiculo	else		msgalert = "Alteração"	end if	RS("CodigoMarca") = CodigoMarca	RS("CodigoModelo") = CodigoModelo	RS("CodigoCor") = CodigoCor	RS("AnoFabricacao") = AnoFabricacao	RS("AnoModelo") = AnoModelo	RS("Combustivel") = Combustivel	RS("Placa") = Placa	RS("Preco") = Preco	RS("Km") = Km	RS("DataCadastro") = DataCadastro	RS("InformacoesAdicionais") = InformacoesAdicionais	if not IsNull(FotoPrincipal) or LimparFoto = "1" then		if RS("FotoPrincipal") <> "" then			Set fso = CreateObject("Scripting.FileSystemObject")			If fso.FileExists(diretorio & "/Imagem/"&RS("FotoPrincipal")) Then				fso.deletefile(diretorio & "/Imagem/"&RS("FotoPrincipal"))			end if			set fso = nothing		end if		RS("FotoPrincipal") = FotoPrincipal	end if	if Fields("FotoPrincipal").FileName <> "" then		FilePath = diretorio & "/Imagem/" & CodigoVeiculo & "_P" & right(Fields("FotoPrincipal").FileName,4)		Fields("FotoPrincipal").Value.SaveAs FilePath		FotoPrincipal = CodigoVeiculo & "_P" & right(Fields("FotoPrincipal").FileName,4)		RS("FotoPrincipal") = FotoPrincipal	end if	if not IsNull(Foto1) or LimparFoto1 = "1" then		if RS("Foto1") <> "" then			Set fso = CreateObject("Scripting.FileSystemObject")			If fso.FileExists(diretorio & "/Imagem/"&RS("Foto1")) Then				fso.deletefile(diretorio & "/Imagem/"&RS("Foto1"))			end if			set fso = nothing		end if		RS("Foto1") = Foto1	end if	if Fields("Foto1").FileName <> "" then		FilePath = diretorio & "/Imagem/" & CodigoVeiculo & "_1_" & right(Fields("Foto1").FileName,4)		Fields("Foto1").Value.SaveAs FilePath		Foto1 = CodigoVeiculo & "_1_" & right(Fields("Foto1").FileName,4)		RS("Foto1") = Foto1	end if	if not IsNull(Foto2) or LimparFoto2 = "1" then		if RS("Foto2") <> "" then			Set fso = CreateObject("Scripting.FileSystemObject")			If fso.FileExists(diretorio & "/Imagem/"&RS("Foto2")) Then				fso.deletefile(diretorio & "/Imagem/"&RS("Foto2"))			end if			set fso = nothing		end if		RS("Foto2") = Foto2	end if	if Fields("Foto2").FileName <> "" then		FilePath = diretorio & "/Imagem/" & CodigoVeiculo & "_2_" & right(Fields("Foto2").FileName,4)		Fields("Foto2").Value.SaveAs FilePath		Foto2 = CodigoVeiculo & "_2_" & right(Fields("Foto2").FileName,4)		RS("Foto2") = Foto2	end if	if not IsNull(Foto3) or LimparFoto3 = "1" then		if RS("Foto3") <> "" then			Set fso = CreateObject("Scripting.FileSystemObject")			If fso.FileExists(diretorio & "/Imagem/"&RS("Foto3")) Then				fso.deletefile(diretorio & "/Imagem/"&RS("Foto3"))			end if			set fso = nothing		end if		RS("Foto3") = Foto3	end if	if Fields("Foto3").FileName <> "" then		FilePath = diretorio & "/Imagem/" & CodigoVeiculo & "_3_" & right(Fields("Foto3").FileName,4)		Fields("Foto3").Value.SaveAs FilePath		Foto3 = CodigoVeiculo & "_3_" & right(Fields("Foto3").FileName,4)		RS("Foto3") = Foto3	end if	RS.Update	RS.close	set RS = nothing	conn.execute("delete from VeiculosOpcionais where CodigoVeiculo = " & CodigoVeiculo )	if CodigoOpcional <> "" then		ArrCodigoOpcional = split(CodigoOpcional,";")		for x = 0 to UBound(ArrCodigoOpcional)			SQLIns = "Insert Into VeiculosOpcionais (CodigoOpcional, CodigoVeiculo) values (" & ArrCodigoOpcional(x) & ", " & CodigoVeiculo & ")"			Conn.execute(SQLIns)		next	end if	Conn.close	set Conn = nothing	msgalert = msgalert & " do Veículo realizada com sucesso."%>	<script>		alert('<%=msgalert%>');		location = "Default.asp?SQL=<%=Server.URLEncode(RSQL)%><%if RSQL <> "" then response.write "&acao=pesquisar"%>";	</script><%else	response.redirect "default.asp"end if%>

 

 

 

--------------------------------------------

 

ate mais.

Compartilhar este post


Link para o post
Compartilhar em outros sites

kra como você conseguiu resolver este erro?? tenho um erro parecido com esse o codigo é o mesmo. hullynickel@hotmail.com

Compartilhar este post


Link para o post
Compartilhar em outros sites

é gerado algum numero de erro !?!?!

se sim poste a linha e numero

dá um response.write na sua string SQL para ver o k esta sendo passado

Compartilhar este post


Link para o post
Compartilhar em outros sites

é gerado algum numero de erro !?!?!

se sim poste a linha e numero

dá um response.write na sua string SQL para ver o k esta sendo passado

 

o erro que gera é este

 

 

Microsoft VBScript runtime error '800a004c'

 

Path not found

 

/clientes/webideia.adm.br/autocarros/central/reusavel/upload.inc, line 289

 

é gerado algum numero de erro !?!?!

se sim poste a linha e numero

dá um response.write na sua string SQL para ver o k esta sendo passado

 

o erro que gera é este

 

Microsoft VBScript runtime error '800a004c'

 

Path not found

 

/clientes/webideia.adm.br/autocarros/central/reusavel/upload.inc, line 289

Compartilhar este post


Link para o post
Compartilhar em outros sites

erro no path

Caminho não encontrado, verifique o caminho

Compartilhar este post


Link para o post
Compartilhar em outros sites

erro no path

Caminho não encontrado, verifique o caminho

 

 

kra ja tentei de tudo ja analisei cada path, nao consigo descobrir add meu msn me ajuda por favor

hullynickel#hotmail.com

Compartilhar este post


Link para o post
Compartilhar em outros sites

Imagine.. se fôssemos ajudar a cada um que posta via MSN... nem daria né ? rs

 

Sugiro, que poste seu código aqui..

 

Caminho não encontrado é detalhe.. provavelmente deve estar na linha que você especifica o diretorio que as imagens ficarão no servidor..

Compartilhar este post


Link para o post
Compartilhar em outros sites

Imagine.. se fôssemos ajudar a cada um que posta via MSN... nem daria né ? rs

 

Sugiro, que poste seu código aqui..

 

Caminho não encontrado é detalhe.. provavelmente deve estar na linha que você especifica o diretorio que as imagens ficarão no servidor..

 

 

p_altera_inclui.asp

 

<!--#include file="../../config.inc"-->

<!--#include file="../../teste/aut.inc"-->

<!--#include file="../../teste/teste2/db.inc"-->

<!--#include file="../../funcoes.inc"-->

<!--#INCLUDE file="../../teste/reusavel/upload.inc"-->

<%if Request.ServerVariables("REQUEST_METHOD") = "POST" then

diretorio = root_central_upload & "/Veiculo/"

'response.write diretorio

 

Set RS = Server.CreateObject("ADODB.RecordSet")

set Fields = GetUpload()

 

acao = Fields("acao").Value.String

CodigoVeiculo = Fields("CodigoVeiculo").Value.String

CodigoMarca = Fields("CodigoMarca").Value.String

CodigoModelo = Fields("CodigoModelo").Value.String

CodigoCor = Fields("CodigoCor").Value.String

AnoFabricacao = Fields("AnoFabricacao").Value.String

AnoModelo = Fields("AnoModelo").Value.String

Combustivel = Fields("Combustivel").Value.String

Placa = Fields("Placa").Value.String

Preco = Fields("Preco").Value.String

Km = Fields("Km").Value.String

FotoPrincipal = Fields("FotoPrincipal").FileName

Foto1 = Fields("Foto1").FileName

Foto2 = Fields("Foto2").FileName

Foto3 = Fields("Foto3").FileName

DataCadastro = Fields("DataCadastro").Value.String

InformacoesAdicionais = Fields("InformacoesAdicionais").Value.String

CodigoOpcional = request.querystring("CodigoOpcional")

 

if CodigoMarca = "" then

msg = "Selecione a Marca do Veículo!"

elseif CodigoModelo = "" then

msg = "Selecione o Modelo do Veículo!"

elseif CodigoCor = "" then

msg = "Selecione a Cor do Veículo!"

elseif Combustivel = "" then

msg = "Selecione o Tipo de Combustível do Veículo!"

elseif KM = "" then

msg = "Digite o quantidade de Kilomêtros Rodados do Veículo!"

elseif Placa = "" then

msg = "Digite o Último dígito da Placa do Veículo!"

elseif AnoFabricacao = "" then

msg = "Digite o ano de Fabricação do Veículo!"

elseif AnoModelo = "" then

msg = "Digite o ano do Modelo do Veículo!"

elseif Preco = "" then

msg = "Digite o valor de Venda do Veículo!"

end if

 

if FotoPrincipal = "" then FotoPrincipal = null

if Foto1 = "" then Foto1 = null

if Foto2 = "" then Foto2 = null

if Foto3 = "" then Foto3 = null

if DataCadastro = "" then DataCadastro = now

if InformacoesAdicionais = "" then InformacoesAdicionais = null

 

if CodigoOpcional = "" then CodigoOpcional = null

 

'Se a mensagem tiver algo

if msg <> "" then%>

<script>

alert("<%=msg%>");

history.go(-1);

</script>

<%response.end

end if

 

if acao = "alterar" then

SQL = "select * from Veiculos where CodigoVeiculo = " & CodigoVeiculo

RS.open SQL, Conn, 1, 3

if RS.eof then

msg = "Parâmetro informado inválido ou incoerente !"

end if

else

CodigoVeiculo = GeraId("Veiculos","CodigoVeiculo")

SQL = "select * from Veiculos where CodigoVeiculo = 0"

RS.open SQL, Conn, 1, 3

end if

 

if acao = "incluir" then

msgalert = "Inclusão"

RS.Addnew

RS("CodigoVeiculo") = CodigoVeiculo

else

msgalert = "Alteração"

end if

RS("CodigoMarca") = CodigoMarca

RS("CodigoModelo") = CodigoModelo

RS("CodigoCor") = CodigoCor

RS("AnoFabricacao") = AnoFabricacao

RS("AnoModelo") = AnoModelo

RS("Combustivel") = Combustivel

RS("Placa") = Placa

RS("Preco") = Preco

RS("Km") = Km

RS("DataCadastro") = DataCadastro

RS("InformacoesAdicionais") = InformacoesAdicionais

 

if not IsNull(FotoPrincipal) or LimparFoto = "1" then

if RS("FotoPrincipal") <> "" then

Set fso = CreateObject("Scripting.FileSystemObject")

If fso.FileExists(diretorio & "/Imagem/"&RS("FotoPrincipal")) Then

fso.deletefile(diretorio & "/Imagem/"&RS("FotoPrincipal"))

end if

set fso = nothing

end if

RS("FotoPrincipal") = FotoPrincipal

end if

if Fields("FotoPrincipal").FileName <> "" then

FilePath = diretorio & "/Imagem/" & CodigoVeiculo & "_P" & right(Fields("FotoPrincipal").FileName,4)

Fields("FotoPrincipal").Value.SaveAs FilePath

FotoPrincipal = CodigoVeiculo & "_P" & right(Fields("FotoPrincipal").FileName,4)

RS("FotoPrincipal") = FotoPrincipal

end if

 

if not IsNull(Foto1) or LimparFoto1 = "1" then

if RS("Foto1") <> "" then

Set fso = CreateObject("Scripting.FileSystemObject")

If fso.FileExists(diretorio & "/Imagem/"&RS("Foto1")) Then

fso.deletefile(diretorio & "/Imagem/"&RS("Foto1"))

end if

set fso = nothing

end if

RS("Foto1") = Foto1

end if

if Fields("Foto1").FileName <> "" then

FilePath = diretorio & "/Imagem/" & CodigoVeiculo & "_1_" & right(Fields("Foto1").FileName,4)

Fields("Foto1").Value.SaveAs FilePath

Foto1 = CodigoVeiculo & "_1_" & right(Fields("Foto1").FileName,4)

RS("Foto1") = Foto1

end if

 

if not IsNull(Foto2) or LimparFoto2 = "1" then

if RS("Foto2") <> "" then

Set fso = CreateObject("Scripting.FileSystemObject")

If fso.FileExists(diretorio & "/Imagem/"&RS("Foto2")) Then

fso.deletefile(diretorio & "/Imagem/"&RS("Foto2"))

end if

set fso = nothing

end if

RS("Foto2") = Foto2

end if

if Fields("Foto2").FileName <> "" then

FilePath = diretorio & "/Imagem/" & CodigoVeiculo & "_2_" & right(Fields("Foto2").FileName,4)

Fields("Foto2").Value.SaveAs FilePath

Foto2 = CodigoVeiculo & "_2_" & right(Fields("Foto2").FileName,4)

RS("Foto2") = Foto2

end if

 

if not IsNull(Foto3) or LimparFoto3 = "1" then

if RS("Foto3") <> "" then

Set fso = CreateObject("Scripting.FileSystemObject")

If fso.FileExists(diretorio & "/Imagem/"&RS("Foto3")) Then

fso.deletefile(diretorio & "/Imagem/"&RS("Foto3"))

end if

set fso = nothing

end if

RS("Foto3") = Foto3

end if

if Fields("Foto3").FileName <> "" then

FilePath = diretorio & "/Imagem/" & CodigoVeiculo & "_3_" & right(Fields("Foto3").FileName,4)

Fields("Foto3").Value.SaveAs FilePath

Foto3 = CodigoVeiculo & "_3_" & right(Fields("Foto3").FileName,4)

RS("Foto3") = Foto3

end if

RS.Update

 

RS.close

set RS = nothing

 

conn.execute("delete from VeiculosOpcionais where CodigoVeiculo = " & CodigoVeiculo )

if CodigoOpcional <> "" then

ArrCodigoOpcional = split(CodigoOpcional,";")

for x = 0 to UBound(ArrCodigoOpcional)

SQLIns = "Insert Into VeiculosOpcionais (CodigoOpcional, CodigoVeiculo) values (" & ArrCodigoOpcional(x) & ", " & CodigoVeiculo & ")"

Conn.execute(SQLIns)

next

end if

Conn.close

set Conn = nothing

 

msgalert = msgalert & " do Veiculo realizada com sucesso."%>

<script>

alert('<%=msgalert%>');

location = "Default.asp?SQL=<%=Server.URLEncode(RSQL)%><%if RSQL <> "" then response.write "&acao=pesquisar"%>";

</script>

<%else

response.redirect "default.asp"

end if%>

 

altera_inclui.asp

 

<!--#include file="../../config.inc"-->

<!--#include file="../aut.inc"-->

<!--#include file="db.inc"-->

<!--#include file="../../funcoes.inc"-->

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

<%CodigoVeiculo = request("CodigoVeiculo")

acao = request("acao")

 

if acao = "" or (acao = "alterar" and CodigoVeiculo = "")then%>

<script>

location = "Default.asp"

</script>

<%response.end

else

Set RS = Server.CreateObject("ADODB.RecordSet")

end if

 

if CodigoVeiculo <> "" and acao = "alterar" then

SQL = "select * " & _

"from Veiculos " &_

"where CodigoVeiculo = " & CodigoVeiculo

RS.open SQL, Conn, 1, 3

if RS.eof then%>

<script>

alert("Parâmetro nescessário não informado !");

location = "Default.asp"

</script>

<%response.end

else

CodigoMarca = RS("CodigoMarca")

CodigoModelo = RS("CodigoModelo")

CodigoCor = RS("CodigoCor")

AnoFabricacao = RS("AnoFabricacao")

AnoModelo = RS("AnoModelo")

Combustivel = RS("Combustivel")

Placa = RS("Placa")

Preco = RS("Preco")

Proprietario = RS("Proprietario")

Contato = RS("Contato")

FotoPrincipal = RS("FotoPrincipal")

Foto1 = RS("Foto1")

Foto2 = RS("Foto2")

Foto3 = RS("Foto3")

Foto4 = RS("Foto4")

DataCadastro = data(RS("DataCadastro"))

InformacoesAdicionais = RS("InformacoesAdicionais")

end if

RS.Close

else

DataCadastro = data(now)

CodigoVeiculo = 0

end if%>

<html>

<head>

<title><%=nome_site%></title>

<!--#include file="../estilo.inc"-->

<script src="<%=root%>funcoes.js" type="text/javascript"></script>

<script LANGUAGE = "JavaScript">

function popup(pagina,targ,largura,altura){

esquerda = (screen.width - largura - 10)/2;

topo = screen.height - 59;

topo = (topo - altura)/2;

param = "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=" + largura + ",height=" + altura + ",top=" + topo + ",left=" + esquerda;

window.open(pagina,targ,param);

}

function abre_foto(janela)

{

window.open("foto.asp?foto="+janela,"popup","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=no,width=390,height=291,top=150 left=150")

}

function valida()

{

CodigoOpcional = document.formulario.CodigoOpcional;

algum = false;

opcionais = ''

for (x=0;x<CodigoOpcional.length-1;x++)

{

if (CodigoOpcional[x].checked)

{

if(opcionais != '')

{

opcionais = opcionais + ';'

}

opcionais = opcionais + CodigoOpcional[x].value

}

}

document.formulario.action = 'p_altera_inclui.asp?CodigoOpcional='+opcionais

 

return true;

}

</script>

</head>

<body id="body" bgcolor="<%=cor_bg%>" leftmargin=0 topmargin=0 bgcolor="White">

<%nome_titulo = "Cadastro de Imoveis"%>

<!--#include file="../titulo.inc"-->

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

<form name="formulario" action="p_altera_inclui.asp" method="post" enctype="multipart/form-data" onsubmit="return valida()">

<input type="hidden" name="SQL" value="<%=Server.HTMLEncode(request("SQL"))%>">

<input type="hidden" name="acao" value="<%=acao%>">

<input type="hidden" name="CodigoVeiculo" value="<%=CodigoVeiculo%>">

<tr bgcolor="#F4F3F1"><td></td></tr>

<tr>

<td align="right" bgcolor="#D4D0C8">

<font face="Verdana,Geneva,Arial,Helvetica,sans-serif" size="1">

<img src="../img/asterisco.gif" width="9" height="9" alt="" border="0">Campos obrigatórios

</font>

</td>

</tr>

<tr bgcolor="#808080"><td></td></tr>

</table>

<table width="100%" border="0" cellspacing="2" cellpadding="0" align="center" class="texto">

<tr>

<td align="right" width="20%">

Data do Anûncio:

</td>

<td width="80%">

<input type="text" name="DataCadastro" size="12" maxlength="10" value="<%=DataCadastro%>" class="campo" OnKeyDown="mascaradata(this.value,this)" OnKeyUp="mascaradata(this.value,this)"><img src="../img/asterisco.gif" width="9" height="9" alt="" border="0">

</td>

<td width="10" nowrap><img src="../img/pixel.asp" width="1" height="1"></td>

</tr>

<script language=JavaScript type=text/javascript>

<!--

function cria_lista(id)

{

var subcategorias=new Array;

<%set RSModelo = Server.CreateObject("AdoDB.RecordSet")

SQL = "Select * from Modelos order by CodigoMarca, Modelo"

RSModelo.open SQL, conn, 1

Marca = ""

subcategoria = ""

while not RSModelo.EOF

if Marca <> RSModelo("CodigoMarca") then

if subcategoria <> "" then

response.write subcategoria & """" & chr(13)

end if

subcategoria = "subcategorias[" & RSModelo("CodigoMarca") & "]=""|;" & RSModelo("CodigoModelo") & "|" & RSModelo("Modelo") & ";"

Marca = RSModelo("CodigoMarca")

else

subcategoria = subcategoria & RSModelo("CodigoModelo") & "|" & RSModelo("Modelo") & ";"

end if

RSModelo.MoveNext

wend

response.write subcategoria & """" & chr(13)%>

if(isUndefined(subcategorias[id]))

{

var categoria=new Array(";");

}

else

{

var categoria=subcategorias[id].split(";");

}

var campo=document.getElementById("CodigoModelo");

for(i=campo.length;i >= 0;i--)

{

campo.options.remove(i);

}

for(i=0;i<=categoria.length-2;i++)

{

var valor=categoria.split("|");

var opcao = document.createElement("OPTION");

campo.options.add(opcao);

opcao.selected = false;

var value = document.createTextNode(valor[1]);

opcao.appendChild(value);

opcao.value = valor[0];

}

}

function isUndefined(v)

{

var undef;

return v===undef;

}

//-->

</SCRIPT>

<tr>

<td align="right">

<font face="<%=nomefonte%>" size="1">

Cidade:

</font>

</td>

<td>

<select name="CodigoMarca" size="1" class="campo" onChange="cria_lista(this.value)">

<option value=""></option>

<%Set RSMarca = Server.CreateObject("ADODB.RecordSet")

RSMarca.Open "Select * from Marcas order by Marca", Conn, 1

while not RSMarca.eof%>

<option value="<%=RSMarca("CodigoMarca")%>" <%if RSMarca("CodigoMarca") = CodigoMarca then response.write " selected"%>><%=RSMarca("Marca")%></option>

<%RSMarca.movenext

wend

RSMarca.close

Set RSMarca = nothing%>

</select><img src="../img/asterisco.gif" width="9" height="9" alt="" border="0">

</td>

<td width="10" nowrap><img src="../img/pixel.asp" width="1" height="1"></td>

</tr>

<tr>

<td align="right">

<font face="<%=nomefonte%>" size="1">Bairro:

</font>

</td>

<td>

<select name="CodigoModelo" size="1" class="campo">

<option value=""></option>

<%if CodigoMarca <> "" then

Set RSModelo = Server.CreateObject("ADODB.RecordSet")

RSModelo.Open "Select * from Modelos where CodigoMarca = " & CodigoMarca, Conn, 1

while not RSModelo.eof%>

<option value="<%=RSModelo("CodigoModelo")%>" <%if RSModelo("CodigoModelo") = CodigoModelo then response.write " selected"%>><%=RSModelo("Modelo")%></option>

<%RSModelo.movenext

wend

RSModelo.close

Set RSModelo = nothing

end if%>

</select><img src="../img/asterisco.gif" width="9" height="9" alt="" border="0">

</td>

<td width="10" nowrap><img src="../img/pixel.asp" width="1" height="1"></td>

</tr>

<tr>

<td align="right">

<font face="<%=nomefonte%>" size="1">

Tipo de Imóvel:

</font>

</td>

<td>

<select name="CodigoCor" size="1" class="campo">

<option value=""></option>

<%Set RSVersao = Server.CreateObject("ADODB.RecordSet")

RSVersao.Open "Select * from Cores order by Cor", Conn, 1

while not RSVersao.eof%>

<option value="<%=RSVersao("CodigoCor")%>" <%if RSVersao("CodigoCor") = CodigoCor then response.write " selected"%>><%=RSVersao("Cor")%></option>

<%RSVersao.movenext

wend

RSVersao.close

Set RSVersao = nothing%>

</select><img src="../img/asterisco.gif" width="9" height="9" alt="" border="0">

</td>

<td width="10" nowrap><img src="../img/pixel.asp" width="1" height="1"></td>

</tr>

<tr>

<td align="right" width="20%">

Categoria:

</td>

<td width="80%">

<input type="text" id="Combustivel" name="Combustivel" size="30" maxlength="20" value="<%=Combustivel%>" class="campo"><img src="../img/asterisco.gif" width="9" height="9" alt="" border="0">

Ex.: ALUGUEL OU VENDA</td>

<td width="10" nowrap><img src="../img/pixel.asp" width="1" height="1"></td>

</tr>

<tr>

<td align="right" width="20%">

Nome Proprietário:

</td>

<td width="80%">

<input type="text" name="Proprietario" size="50" maxlength="30" value="<%=Proprietario%>" class="campo"><img src="../img/asterisco.gif" width="9" height="9" alt="" border="0">

</td>

<td width="10" nowrap><img src="../img/pixel.asp" width="1" height="1"></td>

</tr>

<tr>

<td align="right" width="20%">

Contato Proprietário:

</td>

<td width="80%">

<input type="text" name="Contato" size="25" maxlength="15" value="<%=Contato%>" class="campo"><img src="../img/asterisco.gif" width="9" height="9" alt="" border="0">

Ex.: 31 3333-3333</td>

<td width="10" nowrap><img src="../img/pixel.asp" width="1" height="1"></td>

</tr>

 

<tr>

<td align="right" width="20%">

Codigo:

</td>

<td width="80%">

<input type="text" name="Placa" size="15" maxlength="30" value="<%=Placa%>" class="campo"><img src="../img/asterisco.gif" width="9" height="9" alt="" border="0">

</td>

<td width="10" nowrap><img src="../img/pixel.asp" width="1" height="1"></td>

</tr>

<tr>

<td align="right" width="20%">

Quant. Quartos:

</td>

<td width="80%">

<input type="text" name="AnoFabricacao" size="5" maxlength="1" value="<%=AnoFabricacao%>" class="campo"><img src="../img/asterisco.gif" width="9" height="9" alt="" border="0">

</td>

<td width="10" nowrap><img src="../img/pixel.asp" width="1" height="1"></td>

</tr>

<tr>

<td align="right" width="20%">

Quant. banheiros:

</td>

<td width="80%">

<input type="text" name="AnoModelo" size="5" maxlength="1" value="<%=AnoModelo%>" class="campo"><img src="../img/asterisco.gif" width="9" height="9" alt="" border="0">

</td>

<td width="10" nowrap><img src="../img/pixel.asp" width="1" height="1"></td>

</tr>

<tr>

<td align="right" width="20%">

Preço:

</td>

<td width="80%">

<input type="text" name="Preco" size="12" maxlength="10" value="<%=Preco%>" class="campo" OnKeyDown="mascaranumero(this.value,this)" OnKeyUp="mascaranumero(this.value,this)"><img src="../img/asterisco.gif" width="9" height="9" alt="" border="0">

</td>

<td width="10" nowrap><img src="../img/pixel.asp" width="1" height="1"></td>

</tr>

<tr><td colspan="3" height="1" bgcolor="#000000"></td></tr>

<tr>

<td align="right" width="20%" valign="top">

Opcionais:

</td>

<td width="80%">

<font face="<%=nomefonte%>" size="1">

<%Set RSMenu = Server.CreateObject("ADODB.RecordSet")

SQLMenu = "Select tMod.*, " & chr(13) & _

" (select count(tLig.CodigoOpcional) from VeiculosOpcionais tLig where tLig.CodigoOpcional = tMod.CodigoOpcional and tLig.CodigoVeiculo = " & CodigoVeiculo & ") as Marcado " & chr(13) & _

"FROM Opcionais tMod " & chr(13) & _

"ORDER BY Descricao" & chr(13)

'response.write "<pre>" & SQLMenu & "</pre>"

'response.flush

RSMenu.Open SQLMenu, Conn, 1

while not RSMenu.eof%>

<input type="checkbox" name="CodigoOpcional" value="<%=RSMenu("CodigoOpcional")%>"<%if RSMenu("Marcado") > 0 then response.write " checked"%>>

- <%=RSMenu("Descricao")%><br>

<%RSMenu.movenext

wend%>

</font>

<input type="Hidden" name="CodigoOpcional">

</td>

<td width="10" nowrap><img src="../img/pixel.asp" width="1" height="1"></td>

</tr>

<tr><td colspan="3" height="1" bgcolor="#000000"></td></tr>

<tr>

<td align="right" width="20%" valign="top">

Informações Adicionais:

</td>

<td width="80%">

<%if InformacoesAdicionais = "" or IsNull(InformacoesAdicionais) then

InformacoesAdicionais = "<p>"

end if

Set oFCKeditor = New FCKeditor

oFCKeditor.Config("DefaultLanguage") = "pt-br"

oFCKeditor.BasePath = "../FCKeditor/"

oFCKeditor.Value = InformacoesAdicionais

oFCKeditor.Create "InformacoesAdicionais"

set oFCKeditor = nothing%>

</td>

<td width="10" nowrap><img src="../img/pixel.asp" width="1" height="1"></td>

</tr>

<tr>

<td align="right" width="20%" valign="top">

Foto Principal:

</td>

<td width="80%">

<%if FotoPrincipal <> "" then%><a href="#" class="link" onClick="abre_foto('imagem/<%=FotoPrincipal%>')">Clique aqui para poder ver a foto</a><br><%end if%>

<input type="File" name="FotoPrincipal" size="15" class="campo">

</td>

<td width="10" nowrap><img src="../img/pixel.asp" width="1" height="1"></td>

</tr>

<tr>

<td align="right" width="20%" valign="top">

Foto 1:

</td>

<td width="80%">

<%if Foto1 <> "" then%><a href="#" class="link" onClick="abre_foto('imagem/<%=Foto1%>')">Clique aqui para poder ver a foto</a><br><%end if%>

<input type="File" name="Foto1" size="15" class="campo">

</td>

<td width="10" nowrap><img src="../img/pixel.asp" width="1" height="1"></td>

</tr>

<tr>

<td align="right" width="20%" valign="top">

Foto 2:

</td>

<td width="80%">

<%if Foto2 <> "" then%><a href="#" class="link" onClick="abre_foto('imagem/<%=Foto2%>')">Clique aqui para poder ver a foto</a><br><%end if%>

<input type="File" name="Foto2" size="15" class="campo">

</td>

<td width="10" nowrap><img src="../img/pixel.asp" width="1" height="1"></td>

</tr>

<tr>

<td align="right" width="20%" valign="top">

Foto 3:

</td>

<td width="80%">

<%if Foto3 <> "" then%><a href="#" class="link" onClick="abre_foto('imagem/<%=Foto3%>')">Clique aqui para poder ver a foto</a><br><%end if%>

<input type="File" name="Foto3" size="15" class="campo">

</td>

<td width="10" nowrap><img src="../img/pixel.asp" width="1" height="1"></td>

</tr>

<tr>

<td align="right" width="20%" valign="top">

Foto 4:

</td>

<td width="80%">

<%if Foto4 <> "" then%><a href="#" class="link" onClick="abre_foto('imagem/<%=Foto4%>')">Clique aqui para poder ver a foto</a><br><%end if%>

<input type="File" name="Foto4" size="15" class="campo">

</td>

<td width="10" nowrap><img src="../img/pixel.asp" width="1" height="1"></td>

</tr>

<tr><td colspan="3" bgcolor="#C0C0C0"></td></tr>

<tr>

<td align="center" colspan="3">

<a href="default.asp?sql=<%=Server.URLEncode(request("SQL"))%><%if request("sql") <> "" then response.write "&acao=pesquisar"%>" OnMouseOver="parent.baixo.st('Cancela e retorna para a pesquisa.')" OnMouseOut="parent.baixo.st()"><img src="../img/comando_cancelar.gif" width="70" height="19" alt="" border="0" align="absmiddle"></a>

<a href="javascript:document.formulario.reset()" OnMouseOver="parent.baixo.st('Desfaz as alterações realizadas no formulário.')" OnMouseOut="parent.baixo.st()"><img src="../img/comando_desfazer.gif" width="70" height="19" alt="" border="0" align="absmiddle"></a>

<input type="image" src="../img/comando_<%=acao%>.gif" width="70" height="19" alt="" border="0" align="absmiddle" OnMouseOver="parent.baixo.st('Executa <%if acao = "incluir" then response.write "inclusão" else response.write "alteração"%> e retorna para a pesquisa.')" OnMouseOut="parent.baixo.st()">

</td>

</tr>

</form>

</table>

<%set Rs = nothing

Conn.close

set Conn = nothing%>

</body>

</html>

 

config.inc

 

<%

dim root, root_central, root_intranet, root_central_upload, nome_site, nome_empresa, cor1, cor2, cor3, cor4

dim corfontelivre, corfonteaviso, corfontealerta, corfonte1, corfonte2, corfonte3, corfonte4, nomefonte, charmenu

response.buffer = true

response.expires = 0

root = "autocarros/"

root_central = "/central/"

root_intranet = "/autocarros/"

root_central_upload = Server.MapPath(root & "central")

nome_site = "v6automóveis.com.br"

nome_empresa = "v6automóveis.com.br"

nome_site = "v6automóveis.com.br"

nome_empresa = "v6automóveis.com.br"

cor1 = "white"

cor2 = "#98c1f1"

cor3 = "#346db4"

cor4 = "black"

corfontelivre = "green"

corfonteaviso = "yellow"

corfontealerta = "red"

corfonte1 = "black"

corfonte2 = "black"

corfonte3 = "white"

corfonte4 = "white"

nomefonte = "Verdana,Geneva,Arial,Helvetica,sans-serif"

charmenu = "»"%>

 

upload.inc

<script RUNAT=SERVER LANGUAGE=VBSCRIPT>

Const IncludeType = 2 'ScriptUtilities has two types of the include. This (2) is free. Include (1) is in the registered version.

'True PureASP upload - FREE upload include

'Please (if you want) include link to PSTRUH Software home page if you are using the free script

'c1997-1999 Antonin Foller, PSTRUH Software, http://www.pstruh.cz

'The file is part of ScriptUtilities library

'The file enables http upload to ASP without any components.

'But there is a small problem - ASP does not allow save binary data to the disk.

' So you can use the upload for :

' 1. Upload small files to server-side disk (PureASP upload saves the data by FileSystem object)

' 2. Upload binary/text files of any size to server-side database (RS("BinField") = Upload("FormField").Value)

'The file also simulates part of ByteArray object to convert binary data to a string and save binary data to the disk

 

 

'Limit of upload size

Dim UploadSizeLimit

 

'********************************** GetUpload **********************************

'This function reads all form fields from binary input and returns it as a dictionary object.

'The dictionary object containing form fields. Each form field is represented by six values :

'See HTML documentation of FormFields class (ScriptUtilities, http://www.pstruh.cz)

'.Name name of the form field (<Input Name="..." Type="File,...">)

'.ContentDisposition = Content-Disposition of the form field

'.FileName = Source file name for <input type=file>

'.ContentType = Content-Type for <input type=file>

'.Value = Binary value of the source field.

'.Length = Len of the binary data field

Function GetUpload()

Dim Result

Set Result = Nothing

If Request.ServerVariables("REQUEST_METHOD") = "POST" Then 'Request method must be "POST"

Dim CT, PosB, Boundary, Length, PosE

CT = Request.ServerVariables("HTTP_Content_Type") 'reads Content-Type header

If LCase(Left(CT, 19)) = "multipart/form-data" Then 'Content-Type header must be "multipart/form-data"

 

'This is upload request.

'Get the boundary and length from Content-Type header

PosB = InStr(LCase(CT), "boundary=") 'Finds boundary

If PosB > 0 Then Boundary = Mid(CT, PosB + 9) 'Separetes boundary

 

'****** Error of IE5.01 - doubbles http header

PosB = InStr(LCase(CT), "boundary=")

If PosB > 0 then 'Patch for the IE error

PosB = InStr(Boundary, ",")

If PosB > 0 Then Boundary = Left(Boundary, PosB - 1)

end if

'****** Error of IE5.01 - doubbles http header

 

Length = CLng(Request.ServerVariables("HTTP_Content_Length")) 'Get Content-Length header

If "" & UploadSizeLimit <> "" Then

UploadSizeLimit = CLng(UploadSizeLimit)

If Length > UploadSizeLimit Then

Request.BinaryRead (Length)

Err.Raise 2, "GetUpload", "Upload size " & FormatNumber(Length, 0) & "B exceeds limit of " & FormatNumber(UploadSizeLimit, 0) & "B"

Exit Function

End If

End If

 

If Length > 0 And Boundary <> "" Then 'Are there required informations about upload ?

Boundary = "--" & Boundary

Dim Head, Binary

Binary = Request.BinaryRead(Length) 'Reads binary data from client

 

'Retrieves the upload fields from binary data

Set Result = SeparateFields(Binary, Boundary)

Binary = Empty 'Clear variables

Else

Err.Raise 10, "GetUpload", "Zero length request ."

End If

Else

Err.Raise 11, "GetUpload", "No file sent."

End If

Else

Err.Raise 1, "GetUpload", "Bad request method."

End If

Set GetUpload = Result

End Function

 

'********************************** SeparateFields **********************************

'This function retrieves the upload fields from binary data and retuns the fields as array

'Binary is safearray ( VT_UI1 | VT_ARRAY ) of all document raw binary data from input.

Function SeparateFields(Binary, Boundary)

Dim PosOpenBoundary, PosCloseBoundary, PosEndOfHeader, isLastBoundary

Dim Fields

Boundary = StringToBinary(Boundary)

 

PosOpenBoundary = InStrB(Binary, Boundary)

PosCloseBoundary = InStrB(PosOpenBoundary + LenB(Boundary), Binary, Boundary, 0)

 

Set Fields = CreateObject("Scripting.Dictionary")

Do While (PosOpenBoundary > 0 And PosCloseBoundary > 0 And Not isLastBoundary)

'Header and file/source field data

Dim HeaderContent, FieldContent, bFieldContent

'Header fields

Dim Content_Disposition, FormFieldName, SourceFileName, Content_Type

'Helping variables

Dim Field, TwoCharsAfterEndBoundary

'Get end of header

PosEndOfHeader = InStrB(PosOpenBoundary + Len(Boundary), Binary, StringToBinary(vbCrLf + vbCrLf))

 

'Separates field header

HeaderContent = MidB(Binary, PosOpenBoundary + LenB(Boundary) + 2, PosEndOfHeader - PosOpenBoundary - LenB(Boundary) - 2)

 

'Separates field content

bFieldContent = MidB(Binary, (PosEndOfHeader + 4), PosCloseBoundary - (PosEndOfHeader + 4) - 2)

 

'Separates header fields from header

GetHeadFields BinaryToString(HeaderContent), Content_Disposition, FormFieldName, SourceFileName, Content_Type

 

'Create one field and assign parameters

Set Field = CreateUploadField()'See the JS function bellow

Set FieldContent = CreateBinaryData(bFieldContent,LenB(bFieldContent))'See the JS function bellow

' FieldContent.ByteArray = bFieldContent

' FieldContent.Length = LenB(bFieldContent)

 

Field.Name = FormFieldName

Field.ContentDisposition = Content_Disposition

Field.FilePath = SourceFileName

Field.FileName = GetFileName(SourceFileName)

Field.ContentType = Content_Type

Field.Length = FieldContent.Length

Set Field.Value = FieldContent

 

' response.write "<br>:" & FormFieldName

' response.end

' response.flush

on error resume next

Fields.Add FormFieldName, Field

 

'Is this last boundary ?

TwoCharsAfterEndBoundary = BinaryToString(MidB(Binary, PosCloseBoundary + LenB(Boundary), 2))

isLastBoundary = TwoCharsAfterEndBoundary = "--"

 

If Not isLastBoundary Then 'This is not last boundary - go to next form field.

PosOpenBoundary = PosCloseBoundary

PosCloseBoundary = InStrB(PosOpenBoundary + LenB(Boundary), Binary, Boundary)

End If

Loop

Set SeparateFields = Fields

End Function

 

'********************************** Utilities **********************************

 

'Separates header fields from upload header

Function GetHeadFields(ByVal Head, Content_Disposition, Name, FileName, Content_Type)

Content_Disposition = LTrim(SeparateField(Head, "content-disposition:", ";"))

 

Name = (SeparateField(Head, "name=", ";")) 'ltrim

If Left(Name, 1) = """" Then Name = Mid(Name, 2, Len(Name) - 2)

 

FileName = (SeparateField(Head, "filename=", ";")) 'ltrim

If Left(FileName, 1) = """" Then FileName = Mid(FileName, 2, Len(FileName) - 2)

 

Content_Type = LTrim(SeparateField(Head, "content-type:", ";"))

End Function

 

'Separates one field between sStart and sEnd

Function SeparateField(From, ByVal sStart, ByVal sEnd)

Dim PosB, PosE, sFrom

sFrom = LCase(From)

PosB = InStr(sFrom, sStart)

If PosB > 0 Then

PosB = PosB + Len(sStart)

PosE = InStr(PosB, sFrom, sEnd)

If PosE = 0 Then PosE = InStr(PosB, sFrom, vbCrLf)

If PosE = 0 Then PosE = Len(sFrom) + 1

SeparateField = Mid(From, PosB, PosE - PosB)

Else

SeparateField = Empty

End If

End Function

 

'Separetes file name from the full path of file

Function GetFileName(FullPath)

Dim Pos, PosF

PosF = 0

For Pos = Len(FullPath) To 1 Step -1

Select Case Mid(FullPath, Pos, 1)

Case "/", "\": PosF = Pos + 1: Pos = 0

End Select

Next

If PosF = 0 Then PosF = 1

GetFileName = Mid(FullPath, PosF)

End Function

 

 

'Simulate ByteArray class by JS/VBS

Function BinaryToStringSimple(Binary)

Dim I, S

For I = 1 To LenB(Binary)

S = S & Chr(AscB(MidB(Binary, I, 1)))

Next

BinaryToStringSimple = S

End Function

 

Function BinaryToString(Binary)

' BinaryToString = RSBinaryToString(Binary)

' Exit Function

 

'Optimized version of simple BinaryToString algorithm.

dim cl1, cl2, cl3, pl1, pl2, pl3

Dim L', nullchar

cl1 = 1

cl2 = 1

cl3 = 1

L = LenB(Binary)

 

Do While cl1<=L

pl3 = pl3 & Chr(AscB(MidB(Binary,cl1,1)))

cl1 = cl1 + 1

cl3 = cl3 + 1

if cl3>300 then

pl2 = pl2 & pl3

pl3 = ""

cl3 = 1

cl2 = cl2 + 1

if cl2>200 then

pl1 = pl1 & pl2

pl2 = ""

cl2 = 1

End If

End If

Loop

BinaryToString = pl1 & pl2 & pl3

End Function

 

 

Function RSBinaryToString(xBinary)

'This function converts binary data (VT_UI1 | VT_ARRAY or MultiByte string)

'to string (BSTR) using ADO recordset

'The fastest way - requires ADODB.Recordset

'Use this function instead of BinaryToString if you have ADODB.Recordset installed

'to eliminate problem with PureASP performance

 

Dim Binary

'MultiByte data must be converted to VT_UI1 | VT_ARRAY first.

if vartype(xBinary)=8 then Binary = MultiByteToBinary(xBinary) else Binary = xBinary

 

Dim RS, LBinary

Const adLongVarChar = 201

Set RS = CreateObject("ADODB.Recordset")

LBinary = LenB(Binary)

 

if LBinary>0 then

RS.Fields.Append "mBinary", adLongVarChar, LBinary

RS.Open

RS.AddNew

RS("mBinary").AppendChunk Binary

RS.Update

RSBinaryToString = RS("mBinary")

Else

RSBinaryToString = ""

End If

End Function

 

Function MultiByteToBinary(MultiByte)

' This function converts multibyte string to real binary data (VT_UI1 | VT_ARRAY)

' Using recordset

Dim RS, LMultiByte, Binary

Const adLongVarBinary = 205

Set RS = CreateObject("ADODB.Recordset")

LMultiByte = LenB(MultiByte)

if LMultiByte>0 then

RS.Fields.Append "mBinary", adLongVarBinary, LMultiByte

RS.Open

RS.AddNew

RS("mBinary").AppendChunk MultiByte & ChrB(0)

RS.Update

Binary = RS("mBinary").GetChunk(LMultiByte)

End If

MultiByteToBinary = Binary

End Function

 

 

 

Function StringToBinary(String)

Dim I, B

For I=1 to len(String)

B = B & ChrB(Asc(Mid(String,I,1)))

Next

StringToBinary = B

End Function

 

'The function simulates save binary data using conversion to string and filesystemobject

Function vbsSaveAs(FileName, ByteArray)

Dim FS, TextStream

Set FS = CreateObject("Scripting.FileSystemObject")

 

Set TextStream = FS.CreateTextFile(FileName)

'And this is the problem why only short files - BinaryToString uses byte-to-char VBS conversion. It takes a lot of computer time.

TextStream.Write BinaryToString(ByteArray) ' BinaryToString is in upload.inc.

TextStream.Close

End Function

 

'Simulate ByteArray class by JS/VBS - end

</SCRIPT>

<script RUNAT=SERVER LANGUAGE=JSCRIPT>

//The function creates Field object. I'm sorry to use JScript, but VBScript can't create custom objects till version 5.0

function CreateUploadField(){ return new uf_Init() }

function uf_Init(){

this.Name = null

this.ContentDisposition = null

this.FileName = null

this.FilePath = null

this.ContentType = null

this.Value = null

this.Length = null

}

 

//Simulate ByteArray class by JS/VBS

function CreateBinaryData(Binary, mLength){ return new bin_Init(Binary, mLength) }

function bin_Init(Binary, mLength){

this.ByteArray = Binary

this.Length = mLength

this.String = BinaryToString(Binary)

this.SaveAs = jsSaveAs

}

//function jsBinaryToString(){

// return BinaryToString(this.ByteArray)

//};

function jsSaveAs(FileName){

return vbsSaveAs(FileName, this.ByteArray)

}

//Simulate ByteArray class by JS/VBS - end

 

</SCRIPT>

Compartilhar este post


Link para o post
Compartilhar em outros sites

Provavelmente seu problema tá neste caminho:

 

p_altera_inclui.asp

 

<!--#include file="../../config.inc"-->

<!--#include file="../../teste/aut.inc"-->

<!--#include file="../../teste/teste2/db.inc"-->

<!--#include file="../../funcoes.inc"-->

<!--#INCLUDE file="../../teste/reusavel/upload.inc"-->

<%if Request.ServerVariables("REQUEST_METHOD") = "POST" then

diretorio = root_central_upload & "/Veiculo/"

'response.write diretorio

você precisa verificar se isso que está colocando está correto..

 

Porque, você está usando uma variavel chamada: root_central_upload e concatenando com "/Veiculo/"

Mas, essa variavel root_central_upload vem de onde ?

Ela possui valor ?

 

Acho que o problema está aí...

Compartilhar este post


Link para o post
Compartilhar em outros sites

Provavelmente seu problema tá neste caminho:

 

p_altera_inclui.asp

 

<!--#include file="../../config.inc"-->

<!--#include file="../../teste/aut.inc"-->

<!--#include file="../../teste/teste2/db.inc"-->

<!--#include file="../../funcoes.inc"-->

<!--#INCLUDE file="../../teste/reusavel/upload.inc"-->

<%if Request.ServerVariables("REQUEST_METHOD") = "POST" then

diretorio = root_central_upload & "/Veiculo/"

'response.write diretorio

você precisa verificar se isso que está colocando está correto..

 

Porque, você está usando uma variavel chamada: root_central_upload e concatenando com "/Veiculo/"

Mas, essa variavel root_central_upload vem de onde ?

Ela possui valor ?

 

Acho que o problema está aí...

 

a variavel diretorio = root_central_upload & "/Veiculo/" vem deste arquivo: config.inc

<%

dim root, root_central, root_intranet, root_central_upload, nome_site, nome_empresa, cor1, cor2, cor3, cor4

dim corfontelivre, corfonteaviso, corfontealerta, corfonte1, corfonte2, corfonte3, corfonte4, nomefonte, charmenu

response.buffer = true

response.expires = 0

root = "autocarros/"

root_central = "/central/"

root_intranet = "/autocarros/"

root_central_upload = Server.MapPath(root & "central")

nome_site = "v6automóveis.com.br"

nome_empresa = "v6automóveis.com.br"

nome_site = "v6automóveis.com.br"

nome_empresa = "v6automóveis.com.br"

cor1 = "white"

cor2 = "#98c1f1"

cor3 = "#346db4"

cor4 = "black"

corfontelivre = "green"

corfonteaviso = "yellow"

corfontealerta = "red"

corfonte1 = "black"

corfonte2 = "black"

corfonte3 = "white"

corfonte4 = "white"

nomefonte = "Verdana,Geneva,Arial,Helvetica,sans-serif"

charmenu = "»"%>

 

 

como eu poderia resolver?

Compartilhar este post


Link para o post
Compartilhar em outros sites

exato, eu percebi isto. mas você precisa testar se essas variaveis estão com os valores corretos..

 

root = "autocarros/"

root_central_upload = Server.MapPath(root & "central")

 

Será que ela está pegando o caminho correto do diretorio no servidor?

 

Seu problema parece ser somente este..

Compartilhar este post


Link para o post
Compartilhar em outros sites

exato, eu percebi isto. mas você precisa testar se essas variaveis estão com os valores corretos..

 

root = "autocarros/"

root_central_upload = Server.MapPath(root & "central")

 

Será que ela está pegando o caminho correto do diretorio no servidor?

 

Seu problema parece ser somente este..

 

 

o caminho fisico do meu servidor é este: D:\SITES\webideia.adm.br\autocarros\

 

e seu eu tenta assim:

 

root = "D:\SITES\webideia.adm.br\autocarros\"

root_central = "\central\"

root_intranet = "\autocarros\"

root_central_upload = Server.MapPath("central")

Compartilhar este post


Link para o post
Compartilhar em outros sites

Caminho não encontrado, erro no path,verifique o caminho

muitas vezes fica mais facil você ter um arquivo tipo, config, e nele

especificar os caminhos corretos e depois usar as variaveis como include na pagina, fica mais organizado, e quando for alterar , muda apenas no config.

Compartilhar este post


Link para o post
Compartilhar em outros sites

imprime na tela o caminho que está sendo usado deve ficar mais facil de ver onde ta errando

Compartilhar este post


Link para o post
Compartilhar em outros sites

faz como meu grande amigo, Mariaun disse, dá um response.write na sua variavel para ver o k esta sendo passada...

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.