Ir para conteúdo
Fórum Script Brasil
  • 0

Essa É Para Feras....


kaolapso

Pergunta

Gente já tentei de todas as formas o maldito upload e não consigo....será que vocês poderiam me ajudar a incluir isso em meu codigo?Gostaria de salvar numa pasta chamada fotos e o componente é o Server.CreateObject("ASPUpload.clsUpload")

<%
OPTION EXPLICIT
if session ("logado")="" then response.redirect "login.htm"
%>
<!--#include file="bib_conexao.asp"-->
<%
DIM Rs,RsUp,RsFoto,Conexao,strSQL,Varmarca,Varmotor,Varmodelo,Varcor,Varanofab
DIM Varanomod,Varcomb,Varopcionais,Varpreco,Varfoto,SelCod,VarCodfoto,strCaminho,VarAtualiza
Varmarca=Request.Form("marca")
Varmodelo=Request.Form("modelo")
Varmotor=Request.Form("motor")
Varcor = Request.form("cor")
Varanofab=Request.Form("anofab")
Varanomod=Request.Form("anomod")
Varcomb=Request.Form("comb")
Varopcionais=Request.Form("opcionais")
Varpreco=Request.Form("preço")
Varfoto=Request.Form("foto")
strCaminho= "Fotos\"

SelCod="SELECT * FROM veiculos ORDER BY codveiculo DESC"
strSQL="INSERT INTO veiculos(marca,modelo,motor,cor,anofab,anomod,comb,opcionais,preço,foto) values ('" & Varmarca & "','" & Varmodelo & "','" & Varmotor & "','" & Varcor & "'," & Varanofab & "," & Varanomod & ",'" & Varcomb & "','" & Varopcionais & "','" & Varpreco & "','" & Varfoto & "')"
	Call abre_conexao
	Set Rs = Conexao.Execute(strSQL)
	Set RsUp = Conexao.Execute(SelCod)	
VarCodFoto=RsUp("codveiculo")
VarAtualiza = " UPDATE veiculos SET foto = '" & strCaminho&VarCodFoto & "' WHERE codveiculo=" & VarCodFoto & ""
	Set RsFoto = Conexao.Execute(VarAtualiza)
	Call fecha_conexao
%>
<html>
<head>
<title>adm_backpages.jpg</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<!--Fireworks MX 2004 Dreamweaver MX 2004 target.  Created Sun Apr 25 11:21:47 GMT-0300 (Hora oficial do Brasil) 2004-->
<script language="JavaScript">
<!--
function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function MM_nbGroup(event, grpName) { //v6.0
var i,img,nbArr,args=MM_nbGroup.arguments;
  if (event == "init" && args.length > 2) {
    if ((img = MM_findObj(args[2])) != null && !img.MM_init) {
      img.MM_init = true; img.MM_up = args[3]; img.MM_dn = img.src;
      if ((nbArr = document[grpName]) == null) nbArr = document[grpName] = new Array();
      nbArr[nbArr.length] = img;
      for (i=4; i < args.length-1; i+=2) if ((img = MM_findObj(args[i])) != null) {
        if (!img.MM_up) img.MM_up = img.src;
        img.src = img.MM_dn = args[i+1];
        nbArr[nbArr.length] = img;
    } }
  } else if (event == "over") {
    document.MM_nbOver = nbArr = new Array();
    for (i=1; i < args.length-1; i+=3) if ((img = MM_findObj(args[i])) != null) {
      if (!img.MM_up) img.MM_up = img.src;
      img.src = (img.MM_dn && args[i+2]) ? args[i+2] : ((args[i+1])?args[i+1] : img.MM_up);
      nbArr[nbArr.length] = img;
    }
  } else if (event == "out" ) {
    for (i=0; i < document.MM_nbOver.length; i++) { img = document.MM_nbOver[i]; img.src = (img.MM_dn) ? img.MM_dn : img.MM_up; }
  } else if (event == "down") {
    nbArr = document[grpName];
    if (nbArr) for (i=0; i < nbArr.length; i++) { img=nbArr[i]; img.src = img.MM_up; img.MM_dn = 0; }
    document[grpName] = nbArr = new Array();
    for (i=2; i < args.length-1; i+=2) if ((img = MM_findObj(args[i])) != null) {
      if (!img.MM_up) img.MM_up = img.src;
      img.src = img.MM_dn = (args[i+1])? args[i+1] : img.MM_up;
      nbArr[nbArr.length] = img;
  } }
}

function MM_preloadImages() { //v3.0
 var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
   var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
   if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

//-->
</script>
<style type="text/css">
<!--
body {
	background-color: #3398CC;
}
.style1 {
	font-family: "Courier New", Courier, mono;
	font-size: 36px;
	color: #000066;
}
.style4 {color: #FFFFFF; font-family: Arial, Helvetica, sans-serif; position: absolute; left: 508px; top: 252px; width: 142px; height: 20px; z-index: 2; font-size: 14px;}
a:link {
	color: #FFFFFF;
}
-->
</style>
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);
//-->
</script>
</head>
<body onLoad="MM_preloadImages('img_adm_backpages/adm_backpages_r2_c6_f2.jpg','img_adm_backpages/adm_backpages_r2_c6_f4.jpg','img_adm_backpages/adm_backpages_r2_c6_f3.jpg','img_adm_backpages/adm_backpages_r4_c2_f2.jpg','img_adm_backpages/adm_backpages_r4_c2_f4.jpg','img_adm_backpages/adm_backpages_r4_c2_f3.jpg')">
<div id="Layer1" style="position:absolute; left:140px; top:179px; width:510px; height:65px; z-index:1"><strong><span class="style1">Ve&iacute;culo Cadastrado !<%=VarCodfoto%> </span></strong></div>
<div id="Layer2" class="style4"><a href="adm_cadastroveiculos.asp">Inserir Novo Ve&iacute;culo</a></div>
<table border="0" cellpadding="0" cellspacing="0" width="720">
<!-- fwtable fwsrc="adm_backpages.png" fwbase="adm_backpages.jpg" fwstyle="Dreamweaver" fwdocid = "528597602" fwnested="0" -->
  <tr>
   <td><img src="img_adm_backpages/spacer.gif" width="3" height="1" border="0" alt=""></td>
   <td><img src="img_adm_backpages/spacer.gif" width="25" height="1" border="0" alt=""></td>
   <td><img src="img_adm_backpages/spacer.gif" width="16" height="1" border="0" alt=""></td>
   <td><img src="img_adm_backpages/spacer.gif" width="28" height="1" border="0" alt=""></td>
   <td><img src="img_adm_backpages/spacer.gif" width="591" height="1" border="0" alt=""></td>
   <td><img src="img_adm_backpages/spacer.gif" width="28" height="1" border="0" alt=""></td>
   <td><img src="img_adm_backpages/spacer.gif" width="29" height="1" border="0" alt=""></td>
   <td><img src="img_adm_backpages/spacer.gif" width="1" height="1" border="0" alt=""></td>
  </tr>

  <tr>
   <td colspan="7"><img name="adm_backpages_r1_c1" src="img_adm_backpages/adm_backpages_r1_c1.jpg" width="720" height="350" border="0" alt=""></td>
   <td><img src="img_adm_backpages/spacer.gif" width="1" height="350" border="0" alt=""></td>
  </tr>
  <tr>
   <td rowspan="2" colspan="2"><img name="adm_backpages_r2_c1" src="img_adm_backpages/adm_backpages_r2_c1.jpg" width="28" height="29" border="0" alt=""></td>
   <td colspan="2"><img name="adm_backpages_r2_c3" src="img_adm_backpages/adm_backpages_r2_c3.jpg" width="44" height="12" border="0" alt=""></td>
   <td rowspan="4"><img name="adm_backpages_r2_c5" src="img_adm_backpages/adm_backpages_r2_c5.jpg" width="591" height="50" border="0" alt=""></td>
   <td><a href="#" onMouseOut="MM_nbGroup('out');" onMouseOver="MM_nbGroup('over','adm_backpages_r2_c6','img_adm_backpages/adm_backpages_r2_c6_f2.jpg','img_adm_backpages/adm_backpages_r2_c6_f4.jpg',1);" onClick="MM_nbGroup('down','navbar1','adm_backpages_r2_c6','img_adm_backpages/adm_backpages_r2_c6_f3.jpg',1);"><img name="adm_backpages_r2_c6" src="img_adm_backpages/adm_backpages_r2_c6.jpg" width="28" height="12" border="0" alt=""></a></td>
   <td rowspan="4"><img name="adm_backpages_r2_c7" src="img_adm_backpages/adm_backpages_r2_c7.jpg" width="29" height="50" border="0" alt=""></td>
   <td><img src="img_adm_backpages/spacer.gif" width="1" height="12" border="0" alt=""></td>
  </tr>
  <tr>
   <td colspan="2"><img name="adm_backpages_r3_c3" src="img_adm_backpages/adm_backpages_r3_c3.jpg" width="44" height="17" border="0" alt=""></td>
   <td rowspan="3"><img name="adm_backpages_r3_c6" src="img_adm_backpages/adm_backpages_r3_c6.jpg" width="28" height="38" border="0" alt=""></td>
   <td><img src="img_adm_backpages/spacer.gif" width="1" height="17" border="0" alt=""></td>
  </tr>
  <tr>
   <td rowspan="2"><img name="adm_backpages_r4_c1" src="img_adm_backpages/adm_backpages_r4_c1.jpg" width="3" height="21" border="0" alt=""></td>
   <td colspan="2"><a href="#" onMouseOut="MM_nbGroup('out');" onMouseOver="MM_nbGroup('over','adm_backpages_r4_c2','img_adm_backpages/adm_backpages_r4_c2_f2.jpg','img_adm_backpages/adm_backpages_r4_c2_f4.jpg',1);" onClick="MM_nbGroup('down','navbar1','adm_backpages_r4_c2','img_adm_backpages/adm_backpages_r4_c2_f3.jpg',1);"><img name="adm_backpages_r4_c2" src="img_adm_backpages/adm_backpages_r4_c2.jpg" width="41" height="12" border="0" alt=""></a></td>
   <td rowspan="2"><img name="adm_backpages_r4_c4" src="img_adm_backpages/adm_backpages_r4_c4.jpg" width="28" height="21" border="0" alt=""></td>
   <td><img src="img_adm_backpages/spacer.gif" width="1" height="12" border="0" alt=""></td>
  </tr>
  <tr>
   <td colspan="2"><img name="adm_backpages_r5_c2" src="img_adm_backpages/adm_backpages_r5_c2.jpg" width="41" height="9" border="0" alt=""></td>
   <td><img src="img_adm_backpages/spacer.gif" width="1" height="9" border="0" alt=""></td>
  </tr>
</table>
</body>
</html>

vocês repararam?Eu pego o codigo do veiculo e mudo o nome da foto para não dar conflitos.Espero que possam me ajudar....valeu

Link para o comentário
Compartilhar em outros sites

1 resposta a esta questão

Posts Recomendados

Participe da discussão

Você pode postar agora e se registrar depois. Se você já tem uma conta, acesse agora para postar com sua conta.

Visitante
Responder esta pergunta...

×   Você colou conteúdo com formatação.   Remover formatação

  Apenas 75 emoticons são permitidos.

×   Seu link foi incorporado automaticamente.   Exibir como um link em vez disso

×   Seu conteúdo anterior foi restaurado.   Limpar Editor

×   Você não pode colar imagens diretamente. Carregar ou inserir imagens do URL.



  • Estatísticas dos Fóruns

    • Tópicos
      152,3k
    • Posts
      652,3k
×
×
  • Criar Novo...