Ir para conteúdo

POWERED BY:

Arquivado

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

PRISCILA STOCHINI

Upload de Arquivos...

Recommended Posts

Pessoal, estou com o seguinte problema...peguei neste forum um código para o envio de arquivos, e estou com o seguinte problema...se eu colocar arquivos mto grande ele dá erro e se eu não colocar arquivo tb...querm poderia me ajudar...???

 

FORMULARIO...

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><!-- InstanceBegin template="/Templates/SUPORTE_SIM.dwt" codeOutsideHTMLIsLocked="false" --><head><title>Multiplus - Softwares Técnicos</title><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"><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><style type="text/css"><!--body {	margin-left: 0px;	margin-top: 0px;	margin-right: 0px;	margin-bottom: 0px;}.link{	font-family: Arial, Helvetica, sans-serif;	font-style: normal;	line-height: normal;	text-decoration: none;	color:#FFFFFF;	font-size: 12px;}a.link:hover{	font-family: Arial, Helvetica, sans-serif;	font-style: normal;	line-height: normal;	text-decoration: none;	color:#FF0000;	font-size: 12px;}.link01{	font-family: Arial, Helvetica, sans-serif;	font-style: normal;	line-height: normal;	text-decoration: none;	color:#000000;	font-size: 12px;}a.link01:hover{	font-family: Arial, Helvetica, sans-serif;	font-style: normal;	line-height: normal;	text-decoration: none;	color:#FF0000;	font-size: 12px;}.link02{	font-family: Arial, Helvetica, sans-serif;	font-style: normal;	line-height: normal;	text-decoration: none;	color:#000000;	font-size: 12px;	font-weight: bold;}a.link02:hover{	font-family: Arial, Helvetica, sans-serif;	font-style: normal;	line-height: normal;	text-decoration: none;	color:#FF0000;	font-size: 12px;	font-weight: bold;}.link03{font-family: Arial, Helvetica, sans-serif;	font-style: normal;	line-height: normal;	text-decoration: none;	color:#000042}a.link03:hover{	font-family: Arial, Helvetica, sans-serif;	font-style: normal;	line-height: normal;	text-decoration: none;	color:#FF0000;		}.style1 {font-size: x-small}.style2 {font-style: normal; line-height: normal; text-decoration: none; color:#FFFFFF; font-family: Arial, Helvetica, sans-serif;}--></style></head><body><table width="100%" height="600" border="0" cellpadding="0" cellspacing="0">  <tr>	<td width="14%" height="45" background="../Pictures_Inicial/fundo_1.gif">	  <div align="center">		<font color="#FFFFFF" size="5" face="Arial, Helvetica, sans-serif">		<strong>MULTIPLUS<br>		  <font size="2">Softwares Técnicos</font>		</strong>		</font>	  </div>	</td>	<td width="9%" height="50" nowrap background="../Pictures_Inicial/fundo_1.gif" bgcolor="#FFFFFF">  </td>	<td colspan="2" valign="bottom" background="../Pictures_Inicial/fundo_2.gif"><div align="right" class="style1"><font color="#FFFFFF" face="Arial, Helvetica, sans-serif"><strong><span class="style1"><a href="http://www.multiplus.com" class="style2">Home</a> | <a href="http://www.multiplus.com/Empresa/empresa.htm" class="style2">Empresa</a> | <a href="http://www.multiplus.com/Eventos/Seminarios/prog_semin.htm" class="style2">Cursos e Eventos</a> | <a href="../Atendimento_VIP.htm" class="style2">Atendimento			Vip</a> | <a href="http://www.multiplus.com/Compra/Precos/precos.htm" class="style2">Preços</a> | <a href="../Oportunidades.htm" class="style2">Oportunidades</a> | <a href="http://www.multiplus.com/Auto_atendimento/opiniao.htm" class="style2"> Fale Conosco</a></span></strong></font></div>	</td>  </tr>  <tr>	<td height="555" valign="top" bgcolor="#C5C5C5"><table width="100%" border="2" align="center" cellspacing="1" bordercolor="c5c5c5" bgcolor="#C5C5C5">	  <tr>		<td height="110" valign="top" class="style27"><div align="left"><img src="../SIM/ImagensSIM/suporte.jpg" width="158" height="128"></div></td>	  </tr>	  <tr>		<td height="37" valign="middle" bordercolor="#FFFFFF" bgcolor="#c5c5c5" class="style27"><div align="center" class="style62" style="font-size: 14px; font-weight: bold; font-family: Arial, Helvetica, sans-serif">SUPORTE TÉCNICO</div></td>	  </tr>	  <tr>		<td height="26" valign="middle" bordercolor="#FFFFFF" bgcolor="#D3D3D3" class="style27"><a href="../SIM/PRINCIPALXYZ000.htm" class="link01">Dúvidas Freqüentes</a></td>	  </tr>	  <tr>		<td height="28" valign="middle" bordercolor="#FFFFFF" bgcolor="#D3D3D3" class="style27"><a href="../SIM/Principal_patches.htm" class="link01">Patches de Atualização</a> </td>	  </tr>	  <tr>		<td height="29" valign="middle" bordercolor="#FFFFFF" bgcolor="#D3D3D3" class="style27"><a href="../Enciclopedia/Internet/Enciclopedia.html" class="link01">Enciclopédia Internet</a> </td>	  </tr>	  <tr>		<td height="26" valign="middle" bordercolor="#FFFFFF" bgcolor="#D3D3D3" class="style27"><span class="link01"><a href="../Enciclopedia/Hardware/Enciclopedia.html" class="link01">Guia de Hardware</a> </span></td>	  </tr>	  <tr>		<td height="25" valign="middle" bordercolor="#FFFFFF" bgcolor="#D3D3D3" class="style27"><a href="../Enciclopedia/Otimizacao/Otimizacao_do_sistema.html" class="link01">Otimização do Sistema </a></td>	  </tr>	  <tr>		<td height="29" valign="middle" bordercolor="#FFFFFF" bgcolor="#D3D3D3" class="style27"><p><a href="../SIM/SUGESTAO_FORM.asp" class="link01">Sugestões\Reclamações</a></p></td>	  </tr>	</table></td>	<td colspan="2"><!-- InstanceBeginEditable name="CORPO" -->	  <div id="Layer1" style="position:absolute; left:181px; top:75px; width:820px; height:540px; z-index:1; overflow: auto;">		<form name="sim" action="envia_DUVIDA.asp" method="post" enctype="multipart/form-data">		  <table border="1" cellspacing="0" cellpadding="6" width="797" align="center" bordercolor="#999999">			<tr>			  <td colspan="4" bgcolor="#C5C5C5"><h2 align="center" class="style12" style="font-family: Arial, Helvetica, sans-serif; color: #000000; font-size: 18px; font-weight: bold">Suporte por Internet Multiplus - SIM </h2></td>			</tr>			<tr>			  <td colspan="4"><p class="style56" style="font-family: Arial, Helvetica, sans-serif; font-size: 12px">Os campos marcados com <img src="obrigatorio.gif" width="18" height="18" align="absmiddle"/> são obrigatórios. </p></td>			</tr>			<tr>			  <td width="104" bgcolor="#C5C5C5" class="rotulo_formulario"><div align="right" class="style7" style="font-family: Arial, Helvetica, sans-serif; font-size: 12px; font-weight: bold">Código SIM </div></td>			  <td colspan="3"><span style="font-family: Arial, Helvetica, sans-serif; font-size: 12px; font-weight: bold">				<input name="codigo" type="text" class="formulario" id="codigo" size="20" maxlength="8" />				<img src="obrigatorio.gif" width="18" height="18" align="absmiddle"/></span></td>			</tr>			<tr>			  <td bgcolor="#C5C5C5" class="rotulo_formulario"><div align="right" class="style7" style="font-family: Arial, Helvetica, sans-serif; font-size: 12px; font-weight: bold">Email</div></td>			  <td colspan="3"><span style="font-family: Arial, Helvetica, sans-serif; font-size: 12px; font-weight: bold">				<input name="email" type="text" class="formulario" id="email" size="40" />				<img src="obrigatorio.gif" width="18" height="18" align="absmiddle"/></span></td>			</tr>			<tr>			  <td bgcolor="#C5C5C5" class="rotulo_formulario"><div align="right" class="style7" style="font-family: Arial, Helvetica, sans-serif; font-size: 12px; font-weight: bold">Versão Windows </div></td>			  <td width="232"><span style="font-family: Arial, Helvetica, sans-serif; font-size: 12px; font-weight: bold">				<select name="win" id="win">				  <option value="95" selected="selected">95</option>				  <option value="98">98</option>				  <option value="2000">2000</option>				  <option value="XP">XP</option>				  <option value="ME">ME</option>				</select>				<img src="obrigatorio.gif" width="18" height="18" align="absmiddle"/></span></td>			  <td width="74" bgcolor="#C5C5C5" class="rotulo_formulario"><div align="right" class="style7" style="font-family: Arial, Helvetica, sans-serif; font-size: 12px; font-weight: bold">Processador</div></td>			  <td width="329"><span style="font-family: Arial, Helvetica, sans-serif; font-size: 12px; font-weight: bold">				<input name="proc" type="text" class="formulario" id="proc" size="20" maxlength="50" />				<img src="obrigatorio.gif" width="18" height="18" align="absmiddle"/></span></td>			</tr>			<tr>			  <td bgcolor="#C5C5C5" class="rotulo_formulario"><div align="right" class="style7" style="font-family: Arial, Helvetica, sans-serif; font-size: 12px; font-weight: bold">Versão AutoCAD</div></td>			  <td><span style="font-family: Arial, Helvetica, sans-serif; font-size: 12px; font-weight: bold">				<select name="versaoAUTO" size="1" class="formulario" id="versaoAUTO">				  <option value="R14" selected="selected">R14</option>				  <option value="R2000">R2000</option>				  <option value="R2002">R2002</option>				  <option value="R2004">R2004</option>				  <option value="R2005">R2005</option>				  <option value="R2006">R2006</option>				  <option value="R2007">R2007</option>				</select>				<img src="obrigatorio.gif" width="18" height="18" align="absmiddle"/></span></td>			  <td bgcolor="#C5C5C5"><div align="right" style="font-family: Arial, Helvetica, sans-serif; font-size: 12px; font-weight: bold">Software</div></td>			  <td><span style="font-family: Arial, Helvetica, sans-serif; font-size: 12px; font-weight: bold">				<select size="1" name="Software" id="Software">				  <option selected="selected">Cype Concreto</option>				  <option>Cype Metálicas</option>				  <option>M2*Arq</option>				  <option>Arquimedes</option>				  <option>PRO-Elétrica</option>				  <option>PRO-Hidráulica</option>				  <option>PRO-Ar Condicionado</option>				  <option>EPLANT</option>				  <option>TecnoMETAL</option>				  <option>TecnoSTEEL</option>				  <option>TecnoSOLID</option>				  <option>ArmaFACIL</option>				  <option>ArmaBLOCOS</option>				  <option>Pré - MOLDAR</option>				  <option>Pro - ALVENARIA</option>				</select>				<img src="obrigatorio.gif" width="18" height="18" align="absmiddle"/></span></td>			</tr>			<tr>			  <td bgcolor="#C5C5C5" class="rotulo_formulario"><div align="right" class="style7" style="font-family: Arial, Helvetica, sans-serif; font-size: 12px; font-weight: bold">Versão</div></td>			  <td colspan="3"><span style="font-family: Arial, Helvetica, sans-serif; font-size: 12px; font-weight: bold">				<input name="versao" type="text" class="formulario" id="versao" size="10" maxlength="10" />			  </span><span style="font-family: Arial, Helvetica, sans-serif; font-size: 12px">(Ex.: CYPECAD <span style="font-weight: bold; color: #0000FF">2005.1</span>.a, PRO-Elétrica <span style="font-weight: bold; color: #0000FF">4.0</span> b)</span> <span class="style56" style="font-family: Arial, Helvetica, sans-serif; font-size: 12px; font-weight: bold"><img src="obrigatorio.gif" width="18" height="18" align="absmiddle"/></span></td>			</tr>			<tr>			  <td bgcolor="#C5C5C5" class="rotulo_formulario"><div align="right" class="style7" style="font-family: Arial, Helvetica, sans-serif; font-size: 12px; font-weight: bold">Release (letra)</div></td>			  <td colspan="3"><span style="font-family: Arial, Helvetica, sans-serif; font-size: 12px; font-weight: bold">				<input name="release" type="text" class="formulario" id="release" size="15" />			  </span><span style="font-family: Arial, Helvetica, sans-serif; font-size: 12px">(Ex.: CYPECAD 2005.1.<span style="font-weight: bold; color: #0000FF">a</span>, PRO-Elétrica 4.0 <span style="font-weight: bold; color: #0000FF">b</span>)</span> <span class="style56" style="font-family: Arial, Helvetica, sans-serif; font-size: 12px; font-weight: bold"><img src="obrigatorio.gif" width="18" height="18" align="absmiddle"/></span></td>			</tr>			<tr>			  <td bgcolor="#C5C5C5" class="rotulo_formulario"><div align="right" class="style7" style="font-family: Arial, Helvetica, sans-serif; font-size: 12px; font-weight: bold">Tipo da dúvida </div></td>			  <td colspan="3"><span style="font-family: Arial, Helvetica, sans-serif; font-size: 12px; font-weight: bold">				<select size="1" name="tipo" id="tipo">				  <option selected="selected">Instalação</option>				  <option>Utilização</option>				  <option>Senha</option>				  <option>Outros</option>				</select>				<img src="obrigatorio.gif" width="18" height="18" align="absmiddle"/></span></td>			</tr>			<tr>			  <td bgcolor="#C5C5C5" class="rotulo_formulario"><div align="right" class="style7" style="font-family: Arial, Helvetica, sans-serif; font-size: 12px; font-weight: bold">Dúvida</div></td>			  <td colspan="3"><span style="font-family: Arial, Helvetica, sans-serif; font-size: 12px; font-weight: bold">				<label>				<textarea name="duvida" cols="70" rows="3" id="duvida"></textarea>				<img src="obrigatorio.gif" width="18" height="18" align="absmiddle"/></label>			  </span></td>			</tr>			<tr>			  <td height="38" align="right" bgcolor="#C5C5C5" class="rotulo_formulario style7"><p align="right" style="font-family: Arial, Helvetica, sans-serif; font-size: 12px; font-weight: bold">Anexar</p></td>			  <td colspan="3"><input name="arquivo" type="file" id="arquivo" size="60"/>			  </td>			</tr>		  </table>		  <p align="center">			<input name="Enviar" type="submit" class="formulario" value="Enviar" />			<input name="Apagar" type="reset" class="formulario" id="Apagar" value="Apagar Dados" />		  </p>		</form>	  </div>	<!-- InstanceEndEditable --></td>	<td width="18%" bordercolor="#FFFFFF"> </td>  </tr></table></body><!-- InstanceEnd --></html>

FUNÇÕES PARA ENVIO....

 

<%' Upload Sem componentes ---------------------------------------Sub BuildUploadRequest(RequestBin)on error resume nextPosBeg = 1PosEnd = InStrB(PosBeg, RequestBin, getByteString(Chr(13)))boundary = MidB(RequestBin, PosBeg, PosEnd - PosBeg)BoundaryPos = InStrB(1, RequestBin, boundary)Do Until (BoundaryPos = InStrB(RequestBin, boundary & getByteString("--")))Dim UploadControlSet UploadControl = CreateObject("Scripting.Dictionary")Pos = InStrB(BoundaryPos, RequestBin, getByteString("Content-Disposition"))Pos = InStrB(Pos, RequestBin, getByteString("name="))PosBeg = Pos + 6PosEnd = InStrB(PosBeg, RequestBin, getByteString(Chr(34)))Name = getString(MidB(RequestBin, PosBeg, PosEnd - PosBeg))PosFile = InStrB(BoundaryPos, RequestBin, getByteString("filename="))PosBound = InStrB(PosEnd, RequestBin, boundary)If PosFile <> 0 And (PosFile < PosBound) ThenPosBeg = PosFile + 10PosEnd = InStrB(PosBeg, RequestBin, getByteString(Chr(34)))FileName = getString(MidB(RequestBin, PosBeg, PosEnd - PosBeg))UploadControl.Add "FileName", FileNamePos = InStrB(PosEnd, RequestBin, getByteString("Content-Type:"))PosBeg = Pos + 14PosEnd = InStrB(PosBeg, RequestBin, getByteString(Chr(13)))ContentType = getString(MidB(RequestBin, PosBeg, PosEnd - PosBeg))UploadControl.Add "ContentType", ContentTypePosBeg = PosEnd + 4PosEnd = InStrB(PosBeg, RequestBin, boundary) - 2Value = MidB(RequestBin, PosBeg, PosEnd - PosBeg)ElsePos = InStrB(Pos, RequestBin, getByteString(Chr(13)))PosBeg = Pos + 4PosEnd = InStrB(PosBeg, RequestBin, boundary) - 2Value = getString(MidB(RequestBin, PosBeg, PosEnd - PosBeg))End IfUploadControl.Add "Value", ValueUploadRequest.Add Name, UploadControlBoundaryPos = InStrB(BoundaryPos + LenB(boundary), RequestBin, boundary)LoopEnd SubFunction getByteString(StringStr)For i = 1 To Len(StringStr)Char = Mid(StringStr, i, 1)getByteString = getByteString & ChrB(AscB(Char))NextEnd FunctionFunction getString(StringBin)getString = ""For intCount = 1 To LenB(StringBin)getString = getString & Chr(AscB(MidB(StringBin, intCount, 1)))NextEnd Function' Fim upload sem Componentes -----------------------------------------%>

ENVIANDO...

<!-- #include file = "funcoes_upload.asp" --><%'Chamando Funções, que fazem o Upload funcionarbyteCount = Request.TotalBytesRequestBin = Request.BinaryRead(byteCount)Set UploadRequest = CreateObject("Scripting.Dictionary")BuildUploadRequest RequestBin' Recuperando os Dados Digitados ----------------------Vcodigo = UploadRequest.Item("codigo").Item("Value")Vemail = UploadRequest.Item("email").Item("Value")Vwin = UploadRequest.Item("win").Item("Value")Vproc = UploadRequest.Item("proc").Item("Value")VversaoAUTO = UploadRequest.Item("versao").Item("Value")VSoftware = UploadRequest.Item("Software").Item("Value")Vversao = UploadRequest.Item("versao").Item("Value")Vrelease = UploadRequest.Item("release").Item("Value")Vtipo = UploadRequest.Item("tipo").Item("Value")Vduvida = UploadRequest.Item("duvida").Item("Value")' Tipo de arquivo que esta sendo enviadotipo_arquivo = UploadRequest.Item("arquivo").Item("ContentType")' Caminho completo dos arquivos enviadoscaminho_arquivo = UploadRequest.Item("arquivo").Item("FileName")' Nome dos arquivos enviadosnome_arquivo = Right(caminho_arquivo,Len(caminho_arquivo)-InstrRev(caminho_arquivo,"\"))' Conteudo binario dos arquivos enviadosarquivo = UploadRequest.Item("arquivo").Item("Value")'pasta onde as imagens serao guardadaspasta = Server.MapPath("obras/")nome_arquivo = "/"&nome_arquivo' pasta + nome dos arquivosVarquivo = "obras" + nome_arquivo' Fazendo o Upload do arquivo selecionadoif Varquivo <> "" thenSet ScriptObject = Server.CreateObject("Scripting.FileSystemObject")Set MyFile = ScriptObject.CreateTextFile(pasta & nome_arquivo)For i = 1 to LenB(arquivo)MyFile.Write chr(AscB(MidB(arquivo,i,1)))NextMyFile.Closeend if'============ ENVIO DO E-MAIL ============='Monta MensagemHTML = "<!DOCTYPE HTML PUBLIC ""-//IETF//DTD HTML//EN"">"HTML = HTML & "<html>"HTML = HTML & "<head>"HTML = HTML & "<meta http-equiv=""Content-Type""" HTML = HTML & "content=""text/html; charset=iso-8859-1"">" HTML = HTML & "<title>Contatos</title>" HTML = HTML & "</head>" HTML = HTML & "<B><font size=""4"" color=""#FF0000"" face=""arial""><div align=""center"">DÚVIDA ENVIADA ATRAVÉS DO SITE</div></font></tr></B><BR><HR><BR>"HTML = HTML & "<font size=""3"" face=""arial"">"HTML = HTML & "<B>Data de Envio da Dúvida: " & DATE() & "</B><BR><BR>"HTML = HTML & "<B>CODIGO SIM : </B>" & Vcodigo & "<BR>"HTML = HTML & "<B>Email : </B>" & Vemail & "<BR>"HTML = HTML & "<B>Windows : </B>" & Vwin & "<BR>"HTML = HTML & "<B>Processador : </B>" & Vproc & "<BR>"HTML = HTML & "<B>Versão do AUTO CAD: </B>" & VversaoAUTO & "<BR>"HTML = HTML & "<B>Software : </B>" & Vsoftware & "<BR>"HTML = HTML & "<B>Versão : </B>" & Vversao & "<BR>"HTML = HTML & "<B>Release : </B>" & Vrelease & "<BR>"HTML = HTML & "<B>Tipo da Dúvida : </B>" & Vtipo & "<BR>"HTML = HTML & "<B>Dúvida : </B>" & Vduvida & "<BR>"HTML = HTML & "</font>"HTML = HTML & "<B><BR><HR><HR><BR>"HTML = HTML & "<B><font size=""4"" color=""#FF0000"" face=""arial"">RESPOSTA DO TÉCNICO</font></B><BR><BR>"HTML = HTML & "<font size=""3"" face=""arial"">"HTML = HTML & "<B>Técnico Responsável:<B><BR>"HTML = HTML & "<B>Data de entrega:</B><BR>"HTML = HTML & "<B>Mensagem:<B>"HTML = HTML & "</font>"HTML = HTML & "</body>"HTML = HTML & "</html>"varanexo = Server.MapPath(Varquivo)'Chamamos o componente e enviamos o emailSet myMail = CreateObject("CDONTS.NewMail") myMail.From = "www.cype.com.br" myMail.To = "teste@cype.com.br"myMail.Subject = "DÚVIDAS DO SIM - VIA SITE"myMail.BodyFormat = 0 myMail.MailFormat = 0If varanexo<>"" ThenelsemyMail.Attachfile "varanexo"End IfmyMail.Body = HTML myMail.Send Set myMail = Nothing Set FSO= Server.CreateObject("Scripting.FileSystemObject")If Fso.FileExists(varanexo) ThenSet anexo = FSO.GetFile(varanexo)anexo.deleteend if' Mostra Mensagem de Confirmação na Telaresponse.write("<script>location = '../SIM/PRINCIPALXYZ000.htm';alert('Sua mensagem foi enviada com sucesso!.')</script>")%>

Quem puder me ajudar ficarei grata....

Compartilhar este post


Link para o post
Compartilhar em outros sites

' Tipo de arquivo que esta sendo enviadotipo_arquivo = UploadRequest.Item("arquivo").Item("ContentType")' Caminho completo dos arquivos enviadoscaminho_arquivo = UploadRequest.Item("arquivo").Item("FileName")' Nome dos arquivos enviadosnome_arquivo = Right(caminho_arquivo,Len(caminho_arquivo)-InstrRev(caminho_arquivo,"\"))' Conteudo binario dos arquivos enviadosarquivo = UploadRequest.Item("arquivo").Item("Value")'pasta onde as imagens serao guardadaspasta = Server.MapPath("obras/")nome_arquivo = "/"&nome_arquivo' pasta + nome dos arquivosVarquivo = "obras" + nome_arquivo' Fazendo o Upload do arquivo selecionadoif Varquivo <> "" thenSet ScriptObject = Server.CreateObject("Scripting.FileSystemObject")Set MyFile = ScriptObject.CreateTextFile(pasta & nome_arquivo)For i = 1 to LenB(arquivo)MyFile.Write chr(AscB(MidB(arquivo,i,1)))NextMyFile.Closeend if(..)[b]LINHA 83 varanexo = Server.MapPath(Varquivo)[/b]'Chamamos o componente e enviamos o emailSet myMail = CreateObject("CDONTS.NewMail") myMail.From = "www.cype.com.br" myMail.To = "teste@cype.com.br"myMail.Subject = "DÚVIDAS DO SIM - VIA SITE"myMail.BodyFormat = 0 myMail.MailFormat = 0If varanexo<>"" ThenelsemyMail.Attachfile "varanexo"End IfmyMail.Body = HTML myMail.Send Set myMail = Nothing Set FSO= Server.CreateObject("Scripting.FileSystemObject")If Fso.FileExists(varanexo) ThenSet anexo = FSO.GetFile(varanexo)anexo.deleteend if' Mostra Mensagem de Confirmação na Telaresponse.write("<script>location = '../SIM/PRINCIPALXYZ000.htm';alert('Sua mensagem foi enviada com sucesso!.')</script>")%>

ERRO...

 

Server.MapPath() error 'ASP 0171 : 80004005'

 

Missing Path

 

/CONTROLE/envia_DUVIDA.asp, line 83

 

The Path parameter must be specified for the MapPath method.

 

OUTRO ERRO...

trabalho numa empresa de engenharia e os arquivos são bem grande tipo 2/3Mb ..e já dá erro acima de uns 500 kb....

 

POR FAVOR ME AJUDEM!!!!

Compartilhar este post


Link para o post
Compartilhar em outros sites

sobre upload de arquivos grande você tera que mudar as configurações do servidor:"é ocorrido porque você tentou fazer um upload de um arquivo com tamanho maior do que o IIS está configurado para permitir. Para você configurar o IIS, para que ele permita fazer uploads de arquivos maiores, você deve editar o arquivo metabase.xml (WINNT/system32/metabase.xml) e na linha "AspMaxRequestEntityAllowed" você deve definir o tamanho máximo que cada upload pode suportar. OBSERVAÇÃO: NUNCA EDITE O ARQUIVO METABASE.XML COM O WORDPAD, USE O NOTEPAD... "agora sobre este erro da linha 83 me pareçe que o caminho aonde você esta fazendo upload esta errado

Compartilhar este post


Link para o post
Compartilhar em outros sites

' Tipo de arquivo que esta sendo enviadotipo_arquivo = UploadRequest.Item("arquivo").Item("ContentType")' Caminho completo dos arquivos enviadoscaminho_arquivo = UploadRequest.Item("arquivo").Item("FileName")' Nome dos arquivos enviadosnome_arquivo = Right(caminho_arquivo,Len(caminho_arquivo)-InstrRev(caminho_arquivo,"\"))' Conteudo binario dos arquivos enviadosarquivo = UploadRequest.Item("arquivo").Item("Value")'pasta onde as imagens serao guardadaspasta = Server.MapPath("obras/")nome_arquivo = "/"&nome_arquivo' pasta + nome dos arquivosVarquivo = "obras" + nome_arquivo' Fazendo o Upload do arquivo selecionadoif Varquivo <> "" thenSet ScriptObject = Server.CreateObject("Scripting.FileSystemObject")Set MyFile = ScriptObject.CreateTextFile(pasta & nome_arquivo)For i = 1 to LenB(arquivo)MyFile.Write chr(AscB(MidB(arquivo,i,1)))NextMyFile.Closeend if(..)[b]LINHA 83 varanexo = Server.MapPath(Varquivo)[/b]'Chamamos o componente e enviamos o emailSet myMail = CreateObject("CDONTS.NewMail") myMail.From = "www.cype.com.br" myMail.To = "teste@cype.com.br"myMail.Subject = "DÚVIDAS DO SIM - VIA SITE"myMail.BodyFormat = 0 myMail.MailFormat = 0If varanexo<>"" ThenelsemyMail.Attachfile "varanexo"End IfmyMail.Body = HTML myMail.Send Set myMail = Nothing Set FSO= Server.CreateObject("Scripting.FileSystemObject")If Fso.FileExists(varanexo) ThenSet anexo = FSO.GetFile(varanexo)anexo.deleteend if' Mostra Mensagem de Confirmação na Telaresponse.write("<script>location = '../SIM/PRINCIPALXYZ000.htm';alert('Sua mensagem foi enviada com sucesso!.')</script>")%>
ERRO...Server.MapPath() error 'ASP 0171 : 80004005' Missing Path /CONTROLE/envia_DUVIDA.asp, line 83 The Path parameter must be specified for the MapPath method. OUTRO ERRO...trabalho numa empresa de engenharia e os arquivos são bem grande tipo 2/3Mb ..e já dá erro acima de uns 500 kb....POR FAVOR ME AJUDEM!!!!
PriscilaQuanto ao problema que ocorre quando nenhum arquivo é selecionado, você pode resolver com uma função simples de javascript chamada no momento do envio do formulário, que verifica se o campo está vazio ou não.Já quanto ao tamanho dos arquivos... como ocorre o erro? o sistema fica processando até um certo tempo, e depois dá erro? Ou dá erro logo de cara?Se estiver processando durante algum tempo antes de dar erro, aumenta o timeout da página até que seja suficiente para upload do arquivo.Use: Server.ScriptTimeout = 100 (em segundos)Não costumo trabalhar com Upload usando o FSO, como você está fazendo, mas acredito que não exista limitação de tamanho. Até mais..Cassiano.

Compartilhar este post


Link para o post
Compartilhar em outros sites

sem FSO? mas quer fazer como estão?vai acabar precisando de componentes entao

Compartilhar este post


Link para o post
Compartilhar em outros sites

O que eu preciso é enviar um arquivo por email atraves do formulario como poderia estar fazenod isso sem o FSO!!!???

Na verdade o envio por e-mail vai ser feito pelo componente de e-mail que você estiver usando.. no caso o CDONTS.Antes disso procisa ser feito o upload do arquivo, que pode ser com o FSO (como você já está fazendo) ou por algum outro componente que esteja instalado no servidor que você está usando.Como você disse que a rotina já funciona pra arquivos menores, acho que é só tentar aumentar o tempo de timeout da página, como falei no post anterior, que vai funcionar para arquivos maiores.Faz esse teste.. se não resolver, verifica se tem algum outro componente de e-mail no servidor ou se você teria permissão pra instalar algum.

Compartilhar este post


Link para o post
Compartilhar em outros sites

Quem pode me ajudar, mexi em alguma coisa e parou de funcionar...???!!!!

 

FUNÇÕES...

<%' Upload Sem componentes ---------------------------------------Sub BuildUploadRequest(RequestBin)on error resume nextPosBeg = 1PosEnd = InStrB(PosBeg, RequestBin, getByteString(Chr(13)))boundary = MidB(RequestBin, PosBeg, PosEnd - PosBeg)BoundaryPos = InStrB(1, RequestBin, boundary)Do Until (BoundaryPos = InStrB(RequestBin, boundary & getByteString("--")))Dim UploadControlSet UploadControl = CreateObject("Scripting.Dictionary")Pos = InStrB(BoundaryPos, RequestBin, getByteString("Content-Disposition"))Pos = InStrB(Pos, RequestBin, getByteString("name="))PosBeg = Pos + 6PosEnd = InStrB(PosBeg, RequestBin, getByteString(Chr(34)))Name = getString(MidB(RequestBin, PosBeg, PosEnd - PosBeg))PosFile = InStrB(BoundaryPos, RequestBin, getByteString("filename="))PosBound = InStrB(PosEnd, RequestBin, boundary)If PosFile <> 0 And (PosFile < PosBound) ThenPosBeg = PosFile + 10PosEnd = InStrB(PosBeg, RequestBin, getByteString(Chr(34)))FileName = getString(MidB(RequestBin, PosBeg, PosEnd - PosBeg))UploadControl.Add "FileName", FileNamePos = InStrB(PosEnd, RequestBin, getByteString("Content-Type:"))PosBeg = Pos + 14PosEnd = InStrB(PosBeg, RequestBin, getByteString(Chr(13)))ContentType = getString(MidB(RequestBin, PosBeg, PosEnd - PosBeg))UploadControl.Add "ContentType", ContentTypePosBeg = PosEnd + 4PosEnd = InStrB(PosBeg, RequestBin, boundary) - 2Value = MidB(RequestBin, PosBeg, PosEnd - PosBeg)ElsePos = InStrB(Pos, RequestBin, getByteString(Chr(13)))PosBeg = Pos + 4PosEnd = InStrB(PosBeg, RequestBin, boundary) - 2Value = getString(MidB(RequestBin, PosBeg, PosEnd - PosBeg))End IfUploadControl.Add "Value", ValueUploadRequest.Add Name, UploadControlBoundaryPos = InStrB(BoundaryPos + LenB(boundary), RequestBin, boundary)LoopEnd SubFunction getByteString(StringStr)For i = 1 To Len(StringStr)Char = Mid(StringStr, i, 1)getByteString = getByteString & ChrB(AscB(Char))NextEnd FunctionFunction getString(StringBin)getString = ""For intCount = 1 To LenB(StringBin)getString = getString & Chr(AscB(MidB(StringBin, intCount, 1)))NextEnd Function' Fim upload sem Componentes -----------------------------------------%>

FORMULARIO...

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><!-- InstanceBegin template="/Templates/SUPORTE_SIM.dwt" codeOutsideHTMLIsLocked="false" --><head><title>Multiplus - Softwares Técnicos</title><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"><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><style type="text/css"><!--body {	margin-left: 0px;	margin-top: 0px;	margin-right: 0px;	margin-bottom: 0px;}.link{	font-family: Arial, Helvetica, sans-serif;	font-style: normal;	line-height: normal;	text-decoration: none;	color:#FFFFFF;	font-size: 12px;}a.link:hover{	font-family: Arial, Helvetica, sans-serif;	font-style: normal;	line-height: normal;	text-decoration: none;	color:#FF0000;	font-size: 12px;}.link01{	font-family: Arial, Helvetica, sans-serif;	font-style: normal;	line-height: normal;	text-decoration: none;	color:#000000;	font-size: 12px;}a.link01:hover{	font-family: Arial, Helvetica, sans-serif;	font-style: normal;	line-height: normal;	text-decoration: none;	color:#FF0000;	font-size: 12px;}.link02{	font-family: Arial, Helvetica, sans-serif;	font-style: normal;	line-height: normal;	text-decoration: none;	color:#000000;	font-size: 12px;	font-weight: bold;}a.link02:hover{	font-family: Arial, Helvetica, sans-serif;	font-style: normal;	line-height: normal;	text-decoration: none;	color:#FF0000;	font-size: 12px;	font-weight: bold;}.link03{font-family: Arial, Helvetica, sans-serif;	font-style: normal;	line-height: normal;	text-decoration: none;	color:#000000}a.link03:hover{	font-family: Arial, Helvetica, sans-serif;	font-style: normal;	line-height: normal;	text-decoration: none;	color:#FF0000;		}.style1 {font-size: x-small}.style2 {font-style: normal; line-height: normal; text-decoration: none; color:#FFFFFF; font-family: Arial, Helvetica, sans-serif;}--></style></head><body><table width="100%" height="600" border="0" cellpadding="0" cellspacing="0">  <tr>	<td width="14%" height="45" background="../Pictures_Inicial/fundo_1.gif">	  <div align="center">		<font color="#FFFFFF" size="5" face="Arial, Helvetica, sans-serif">		<strong>MULTIPLUS<br>		  <font size="2">Softwares Técnicos</font>		</strong>		</font>	  </div>	</td>	<td width="9%" height="50" nowrap background="../Pictures_Inicial/fundo_1.gif" bgcolor="#FFFFFF">  </td>	<td colspan="2" valign="bottom" background="../Pictures_Inicial/fundo_2.gif"><div align="right" class="style1"><font color="#FFFFFF" face="Arial, Helvetica, sans-serif"><strong><span class="style1"><a href="http://www.multiplus.com" class="style2">Home</a> | <a href="http://www.multiplus.com/Empresa/empresa.htm" class="style2">Empresa</a> | <a href="http://www.multiplus.com/Eventos/Seminarios/prog_semin.htm" class="style2">Cursos e Eventos</a> | <a href="../Atendimento_VIP.htm" class="style2">Atendimento			Vip</a> | <a href="http://www.multiplus.com/Compra/Precos/precos.htm" class="style2">Preços</a> | <a href="../Oportunidades.htm" class="style2">Oportunidades</a> | <a href="http://www.multiplus.com/Auto_atendimento/opiniao.htm" class="style2"> Fale Conosco</a></span></strong></font></div>	</td>  </tr>  <tr>	<td height="555" valign="top" bgcolor="#C5C5C5"><table width="100%" border="2" align="center" cellspacing="1" bordercolor="c5c5c5" bgcolor="#C5C5C5">	  <tr>		<td height="110" valign="top" class="style27"><div align="left"><img src="../SIM/ImagensSIM/suporte.jpg" width="158" height="128"></div></td>	  </tr>	  <tr>		<td height="37" valign="middle" bordercolor="#FFFFFF" bgcolor="#c5c5c5" class="style27"><div align="center" class="style62" style="font-size: 14px; font-weight: bold; font-family: Arial, Helvetica, sans-serif">SUPORTE TÉCNICO</div></td>	  </tr>	  <tr>		<td height="26" valign="middle" bordercolor="#FFFFFF" bgcolor="#D3D3D3" class="style27"><a href="../SIM/PRINCIPALXYZ000.htm" class="link01">Dúvidas Freqüentes</a></td>	  </tr>	  <tr>		<td height="28" valign="middle" bordercolor="#FFFFFF" bgcolor="#D3D3D3" class="style27"><a href="../SIM/Principal_patches.htm" class="link01">Patches de Atualização</a> </td>	  </tr>	  <tr>		<td height="29" valign="middle" bordercolor="#FFFFFF" bgcolor="#D3D3D3" class="style27"><a href="../Enciclopedia/Internet/Enciclopedia.html" class="link01">Enciclopédia Internet</a> </td>	  </tr>	  <tr>		<td height="26" valign="middle" bordercolor="#FFFFFF" bgcolor="#D3D3D3" class="style27"><span class="link01"><a href="../Enciclopedia/Hardware/Enciclopedia.html" class="link01">Guia de Hardware</a> </span></td>	  </tr>	  <tr>		<td height="25" valign="middle" bordercolor="#FFFFFF" bgcolor="#D3D3D3" class="style27"><a href="../Enciclopedia/Otimizacao/Otimizacao_do_sistema.html" class="link01">Otimização do Sistema </a></td>	  </tr>	  <tr>		<td height="29" valign="middle" bordercolor="#FFFFFF" bgcolor="#D3D3D3" class="style27"><p><a href="../SIM/SUGESTAO_FORM.asp" class="link01">Sugestões\Reclamações</a></p></td>	  </tr>	</table></td>	<td colspan="2"><!-- InstanceBeginEditable name="CORPO" -->	  <div id="Layer1" style="position:absolute; left:181px; top:75px; width:850px; height:515px; z-index:1; overflow: auto;">		<form name="sim" action="envia_DUVIDA.asp" method="post" enctype="multipart/form-data">		  <table border="1" cellspacing="0" cellpadding="6" width="751" align="center" bordercolor="#999999">			<tr>			  <td colspan="4" bgcolor="#C5C5C5"><div align="center"><span style="font-family: Arial, Helvetica, sans-serif; font-weight: bold">Suporte por Internet Multiplus - SIM </span></div></td>			</tr>			<tr>			  <td colspan="4"><p class="style56" style="font-family: Arial, Helvetica, sans-serif; font-size: 12px">Os campos marcados com <img src="obrigatorio.gif" width="18" height="18" align="absmiddle"/> são obrigatórios. </p></td>			</tr>			<tr>			  <td width="101" bgcolor="#C5C5C5" class="rotulo_formulario"><div align="right" class="style7" style="font-family: Arial, Helvetica, sans-serif; font-size: 12px; font-weight: bold">Código SIM </div></td>			  <td colspan="3"><span style="font-family: Arial, Helvetica, sans-serif; font-size: 12px; font-weight: bold">				<input name="codigo" type="text" class="formulario" id="codigo" size="20" maxlength="8" />				<img src="obrigatorio.gif" width="18" height="18" align="absmiddle"/></span></td>			</tr>			<tr>			  <td bgcolor="#C5C5C5" class="rotulo_formulario"><div align="right" class="style7" style="font-family: Arial, Helvetica, sans-serif; font-size: 12px; font-weight: bold">Email</div></td>			  <td colspan="3"><span style="font-family: Arial, Helvetica, sans-serif; font-size: 12px; font-weight: bold">				<input name="email" type="text" class="formulario" id="email" size="40" />				<img src="obrigatorio.gif" width="18" height="18" align="absmiddle"/></span></td>			</tr>			<tr>			  <td bgcolor="#C5C5C5" class="rotulo_formulario"><div align="right" class="style7" style="font-family: Arial, Helvetica, sans-serif; font-size: 12px; font-weight: bold">Versão Windows </div></td>			  <td width="187"><span style="font-family: Arial, Helvetica, sans-serif; font-size: 12px; font-weight: bold">				<select name="win" id="win">				  <option value="95" selected="selected">95</option>				  <option value="98">98</option>				  <option value="2000">2000</option>				  <option value="XP">XP</option>				  <option value="ME">ME</option>				</select>			  <img src="obrigatorio.gif" width="18" height="18" align="absmiddle"/></span></td>			  <td width="74" bgcolor="#C5C5C5" class="rotulo_formulario"><div align="right" class="style7" style="font-family: Arial, Helvetica, sans-serif; font-size: 12px; font-weight: bold">Processador</div></td>			  <td width="331"><span style="font-family: Arial, Helvetica, sans-serif; font-size: 12px; font-weight: bold">				<input name="proc" type="text" class="formulario" id="proc" size="20" maxlength="50" />			  <img src="obrigatorio.gif" width="18" height="18" align="absmiddle"/></span></td>			</tr>			<tr>			  <td bgcolor="#C5C5C5" class="rotulo_formulario"><div align="right" class="style7" style="font-family: Arial, Helvetica, sans-serif; font-size: 12px; font-weight: bold">Versão AutoCAD</div></td>			  <td><span style="font-family: Arial, Helvetica, sans-serif; font-size: 12px; font-weight: bold">				<select name="versaoAUTO" size="1" class="formulario" id="versaoAUTO">				  <option value="R14" selected="selected">R14</option>				  <option value="R2000">R2000</option>				  <option value="R2002">R2002</option>				  <option value="R2004">R2004</option>				  <option value="R2005">R2005</option>				  <option value="R2006">R2006</option>				  <option value="R2007">R2007</option>				</select>				<img src="obrigatorio.gif" width="18" height="18" align="absmiddle"/></span></td>			  <td bgcolor="#C5C5C5"><div align="right" style="font-family: Arial, Helvetica, sans-serif; font-size: 12px; font-weight: bold">Software</div></td>			  <td><span style="font-family: Arial, Helvetica, sans-serif; font-size: 12px; font-weight: bold">				<select size="1" name="Software" id="Software">				  <option selected="selected">Cype Concreto</option>				  <option>Cype Metálicas</option>				  <option>M2*Arq</option>				  <option>Arquimedes</option>				  <option>PRO-Elétrica</option>				  <option>PRO-Hidráulica</option>				  <option>PRO-Ar Condicionado</option>				  <option>EPLANT</option>				  <option>TecnoMETAL</option>				  <option>TecnoSTEEL</option>				  <option>TecnoSOLID</option>				  <option>ArmaFACIL</option>				  <option>ArmaBLOCOS</option>				  <option>Pré - MOLDAR</option>				  <option>Pro - ALVENARIA</option>				</select>				<img src="obrigatorio.gif" width="18" height="18" align="absmiddle"/></span></td>			</tr>			<tr>			  <td bgcolor="#C5C5C5" class="rotulo_formulario"><div align="right" class="style7" style="font-family: Arial, Helvetica, sans-serif; font-size: 12px; font-weight: bold">Versão</div></td>			  <td colspan="3"><span style="font-family: Arial, Helvetica, sans-serif; font-size: 12px; font-weight: bold">				<input name="versao" type="text" class="formulario" id="versao" size="10" maxlength="10" />			  </span><span style="font-family: Arial, Helvetica, sans-serif; font-size: 12px">(Ex.: CYPECAD <span style="font-weight: bold; color: #0000FF">2005.1</span>.a, PRO-Elétrica <span style="font-weight: bold; color: #0000FF">4.0</span> b)</span> <span class="style56" style="font-family: Arial, Helvetica, sans-serif; font-size: 12px; font-weight: bold"><img src="obrigatorio.gif" width="18" height="18" align="absmiddle"/></span></td>			</tr>			<tr>			  <td bgcolor="#C5C5C5" class="rotulo_formulario"><div align="right" class="style7" style="font-family: Arial, Helvetica, sans-serif; font-size: 12px; font-weight: bold">Release (letra)</div></td>			  <td colspan="3"><span style="font-family: Arial, Helvetica, sans-serif; font-size: 12px; font-weight: bold">				<input name="release" type="text" class="formulario" id="release" size="15" />			  </span><span style="font-family: Arial, Helvetica, sans-serif; font-size: 12px">(Ex.: CYPECAD 2005.1.<span style="font-weight: bold; color: #0000FF">a</span>, PRO-Elétrica 4.0 <span style="font-weight: bold; color: #0000FF">b</span>)</span> <span class="style56" style="font-family: Arial, Helvetica, sans-serif; font-size: 12px; font-weight: bold"><img src="obrigatorio.gif" width="18" height="18" align="absmiddle"/></span></td>			</tr>			<tr>			  <td bgcolor="#C5C5C5" class="rotulo_formulario"><div align="right" class="style7" style="font-family: Arial, Helvetica, sans-serif; font-size: 12px; font-weight: bold">Tipo da dúvida </div></td>			  <td colspan="3"><span style="font-family: Arial, Helvetica, sans-serif; font-size: 12px; font-weight: bold">				<select size="1" name="tipo" id="tipo">				  <option selected="selected">Instalação</option>				  <option>Utilização</option>				  <option>Senha</option>				  <option>Outros</option>				</select>				<img src="obrigatorio.gif" width="18" height="18" align="absmiddle"/></span></td>			</tr>			<tr>			  <td bgcolor="#C5C5C5" class="rotulo_formulario"><div align="right" class="style7" style="font-family: Arial, Helvetica, sans-serif; font-size: 12px; font-weight: bold">Dúvida</div></td>			  <td colspan="3"><span style="font-family: Arial, Helvetica, sans-serif; font-size: 12px; font-weight: bold">				<label>				<textarea name="duvida" cols="70" rows="3" id="duvida"></textarea>				<img src="obrigatorio.gif" width="18" height="18" align="absmiddle"/></label>			  </span></td>			</tr>			<tr>			  <td height="38" align="right" bgcolor="#C5C5C5" class="rotulo_formulario style7"><p align="right" style="font-family: Arial, Helvetica, sans-serif; font-size: 12px; font-weight: bold">Anexar</p></td>			  <td colspan="3"><input name="arquivo" type="file" id="arquivo" size="60"/>				<p align="justify" style="font-family: Arial, Helvetica, sans-serif; font-size: 12px"><span style="font-weight: bold"><span style="color: #FF0000">Atenção!</span> Instruções para anexar   arquivos:</span><BR>				  Para enviar  uma obra (arquivos CYP ou M3D), figuras (arquivos JPG e GIF) ou 				  desenhos (arquivos DXF, DWG) <span style="font-weight: bold">acima de 1 Mb</span> anexe estes arquivos ao seu e-mail, informando   no assunto o seu Código de Acesso 				  ao SIM e envie para o endereço <A href="mailto:multitecnico@multiplus.com" class="link02" style="font-weight: bold">obras@multiplus.com</A>. Este endereço   é de uso exclusivo para receber arquivos 			  anexados. <span style="color: #FF0000">Atenção! </span>Dúvidas Técnicas somente serão respondidas através do formulário   acima.</p></td>			</tr>		  </table>		  <p align="center">			<input name="Enviar" type="submit" class="formulario" value="Enviar" />			<input name="Apagar" type="reset" class="formulario" id="Apagar" value="Apagar Dados" />		  </p>		</form>	  </div>	<!-- InstanceEndEditable --></td>	<td width="18%" bordercolor="#FFFFFF"> </td>  </tr></table></body><!-- InstanceEnd --></html>

ENVIO...

 

<!-- #include file = "funcoes_upload.asp" --><%byteCount = Request.TotalBytesRequestBin = Request.BinaryRead(byteCount)Set UploadRequest = CreateObject("Scripting.Dictionary")BuildUploadRequest RequestBinVcodigo = UploadRequest.Item("codigo").Item("Value")Vemail = UploadRequest.Item("email").Item("Value")Vwin = UploadRequest.Item("win").Item("Value")Vproc = UploadRequest.Item("proc").Item("Value")VversaoAUTO = UploadRequest.Item("versao").Item("Value")VSoftware = UploadRequest.Item("Software").Item("Value")Vversao = UploadRequest.Item("versao").Item("Value")Vrelease = UploadRequest.Item("release").Item("Value")Vtipo = UploadRequest.Item("tipo").Item("Value")Vduvida = UploadRequest.Item("duvida").Item("Value")tipo_arquivo = UploadRequest.Item("arquivo").Item("ContentType")caminho_arquivo = UploadRequest.Item("arquivo").Item("FileName")nome_arquivo = Right(caminho_arquivo,Len(caminho_arquivo)-InstrRev(caminho_arquivo,"\"))arquivo = UploadRequest.Item("arquivo").Item("Value")pasta = Server.MapPath("obras/")nome_arquivo = "/"&nome_arquivoVarquivo = "obras" + nome_arquivoif Varquivo <> "" thenSet ScriptObject = Server.CreateObject("Scripting.FileSystemObject")Set MyFile = ScriptObject.CreateTextFile(pasta & nome_arquivo)For i = 1 to LenB(arquivo)MyFile.Write chr(AscB(MidB(arquivo,i,1)))NextMyFile.Closeend ifHTML = "<!DOCTYPE HTML PUBLIC ""-//IETF//DTD HTML//EN"">"HTML = HTML & "<html>"HTML = HTML & "<head>"HTML = HTML & "<meta http-equiv=""Content-Type""" HTML = HTML & "content=""text/html; charset=iso-8859-1"">" HTML = HTML & "<title>Contatos</title>" HTML = HTML & "</head>" HTML = HTML & "<B><font size=""4"" color=""#FF0000"" face=""arial""><div align=""center"">DÚVIDA ENVIADA ATRAVÉS DO SITE</div></font></tr></B><BR><HR><BR>"HTML = HTML & "<font size=""3"" face=""arial"">"HTML = HTML & "<B>Data de Envio da Dúvida: " & DATE() & "</B><BR><BR>"HTML = HTML & "<B>CODIGO SIM : </B>" & Vcodigo & "<BR>"HTML = HTML & "<B>Email : </B>" & Vemail & "<BR>"HTML = HTML & "<B>Windows : </B>" & Vwin & "<BR>"HTML = HTML & "<B>Processador : </B>" & Vproc & "<BR>"HTML = HTML & "<B>Versão do AUTO CAD: </B>" & VversaoAUTO & "<BR>"HTML = HTML & "<B>Software : </B>" & Vsoftware & "<BR>"HTML = HTML & "<B>Versão : </B>" & Vversao & "<BR>"HTML = HTML & "<B>Release : </B>" & Vrelease & "<BR>"HTML = HTML & "<B>Tipo da Dúvida : </B>" & Vtipo & "<BR>"HTML = HTML & "<B>Dúvida : </B>" & Vduvida & "<BR>"HTML = HTML & "</font>"HTML = HTML & "<B><BR><HR><HR><BR>"HTML = HTML & "<B><font size=""4"" color=""#FF0000"" face=""arial"">RESPOSTA DO TÉCNICO</font></B><BR><BR>"HTML = HTML & "<font size=""3"" face=""arial"">"HTML = HTML & "<B>Técnico Responsável:<B><BR>"HTML = HTML & "<B>Data de entrega:</B><BR>"HTML = HTML & "<B>Mensagem:<B>"HTML = HTML & "</font>"HTML = HTML & "</body>"HTML = HTML & "</html>"Server.ScriptTimeout = 100varanexo = Server.MapPath(Varquivo)Set myMail = CreateObject("CDONTS.NewMail") myMail.From = "SITE" myMail.To = "teste@cype.com.br"myMail.Subject = "DÚVIDAS DO SIM - VIA SITE"myMail.BodyFormat = 0 myMail.MailFormat = 0myMail.Attachfile varanexo myMail.Body = HTML myMail.Send Set myMail = Nothing Set FSO= Server.CreateObject("Scripting.FileSystemObject")If Fso.FileExists(varanexo) ThenSet anexo = FSO.GetFile(varanexo)anexo.deleteend ifresponse.write("<script>location = '../SIM/PRINCIPALXYZ000.htm';alert('Sua mensagem foi enviada com sucesso!.')</script>")%>

Ah, e qm puder me ajudar a fazer com que se não houver arquivo envie normalmente o formulario eu ficarei grata!!!

Compartilhar este post


Link para o post
Compartilhar em outros sites

Quem pode me ajudar, mexi em alguma coisa e parou de funcionar...???!!!!Ah, e qm puder me ajudar a fazer com que se não houver arquivo envie normalmente o formulario eu ficarei grata!!!

PriscilaVamos por partes..Já que parou de funcionar, e você não sabe em que você mexeu, tenta voltar pra versão antiga.Depois disso, no arquivo de envio acrescente aquela linha do timeout logo no início.Quanto ao outro problema.. você quer que envie o e-mail mesmo que não haja anexo, certo?Se for isso, faça algo do tipo:
anexar = falseIf arquivo <> "" Then   anexar = TrueEnd If
e na hora de enviar o e-mail:
'Chamamos o componente e enviamos o emailSet myMail = CreateObject("CDONTS.NewMail") myMail.From = "www.cype.com.br" myMail.To = "teste@cype.com.br"myMail.Subject = "DÚVIDAS DO SIM - VIA SITE"myMail.BodyFormat = 0 myMail.MailFormat = 0If anexar Then   myMail.Attachfile "varanexo"End IfmyMail.Body = HTML myMail.Send
AbraçoCassiano.

Compartilhar este post


Link para o post
Compartilhar em outros sites

Esse são meus codigos, pode me ajudar a ver o que está errado???

 

ENVIO...

<!-- #include file = "funcoes_upload.asp" --><%byteCount = Request.TotalBytesRequestBin = Request.BinaryRead(byteCount)Set UploadRequest = CreateObject("Scripting.Dictionary")BuildUploadRequest RequestBinVcodigo = UploadRequest.Item("codigo").Item("Value")Vemail = UploadRequest.Item("email").Item("Value")Vwin = UploadRequest.Item("win").Item("Value")Vproc = UploadRequest.Item("proc").Item("Value")VversaoAUTO = UploadRequest.Item("versao").Item("Value")VSoftware = UploadRequest.Item("Software").Item("Value")Vversao = UploadRequest.Item("versao").Item("Value")Vrelease = UploadRequest.Item("release").Item("Value")Vtipo = UploadRequest.Item("tipo").Item("Value")Vduvida = UploadRequest.Item("duvida").Item("Value")tipo_arquivo = UploadRequest.Item("arquivo").Item("ContentType")caminho_arquivo = UploadRequest.Item("arquivo").Item("FileName")nome_arquivo = Right(caminho_arquivo,Len(caminho_arquivo)-InstrRev(caminho_arquivo,"\"))arquivo = UploadRequest.Item("arquivo").Item("Value")pasta = Server.MapPath("obras/")nome_arquivo = "/"&nome_arquivoVarquivo = "obras" + nome_arquivoif Varquivo <> "" thenSet ScriptObject = Server.CreateObject("Scripting.FileSystemObject")Set MyFile = ScriptObject.CreateTextFile(pasta & nome_arquivo)For i = 1 to LenB(arquivo)MyFile.Write chr(AscB(MidB(arquivo,i,1)))NextMyFile.Closeend ifanexar = falseIf arquivo <> "" Then   anexar = TrueEnd IfHTML = "<!DOCTYPE HTML PUBLIC ""-//IETF//DTD HTML//EN"">"HTML = HTML & "<html>"HTML = HTML & "<head>"HTML = HTML & "<meta http-equiv=""Content-Type""" HTML = HTML & "content=""text/html; charset=iso-8859-1"">" HTML = HTML & "<title>Contatos</title>" HTML = HTML & "</head>" HTML = HTML & "<B><font size=""4"" color=""#FF0000"" face=""arial""><div align=""center"">DÚVIDA ENVIADA ATRAVÉS DO SITE</div></font></tr></B><BR><HR><BR>"HTML = HTML & "<font size=""3"" face=""arial"">"HTML = HTML & "<B>Data de Envio da Dúvida: " & DATE() & "</B><BR><BR>"HTML = HTML & "<B>CODIGO SIM : </B>" & Vcodigo & "<BR>"HTML = HTML & "<B>Email : </B>" & Vemail & "<BR>"HTML = HTML & "<B>Windows : </B>" & Vwin & "<BR>"HTML = HTML & "<B>Processador : </B>" & Vproc & "<BR>"HTML = HTML & "<B>Versão do AUTO CAD: </B>" & VversaoAUTO & "<BR>"HTML = HTML & "<B>Software : </B>" & Vsoftware & "<BR>"HTML = HTML & "<B>Versão : </B>" & Vversao & "<BR>"HTML = HTML & "<B>Release : </B>" & Vrelease & "<BR>"HTML = HTML & "<B>Tipo da Dúvida : </B>" & Vtipo & "<BR>"HTML = HTML & "<B>Dúvida : </B>" & Vduvida & "<BR>"HTML = HTML & "</font>"HTML = HTML & "<B><BR><HR><HR><BR>"HTML = HTML & "<B><font size=""4"" color=""#FF0000"" face=""arial"">RESPOSTA DO TÉCNICO</font></B><BR><BR>"HTML = HTML & "<font size=""3"" face=""arial"">"HTML = HTML & "<B>Técnico Responsável:<B><BR>"HTML = HTML & "<B>Data de entrega:</B><BR>"HTML = HTML & "<B>Mensagem:<B>"HTML = HTML & "</font>"HTML = HTML & "</body>"HTML = HTML & "</html>"Server.ScriptTimeout = 100varanexo = Server.MapPath(Varquivo)Set myMail = CreateObject("CDONTS.NewMail") myMail.From = "SITE" myMail.To = "multitecnico@multiplus.com"myMail.Subject = "DÚVIDAS DO SIM - VIA SITE"myMail.BodyFormat = 0 myMail.MailFormat = 0If anexar Then   myMail.Attachfile "varanexo"End IfmyMail.Body = HTML myMail.Send Set myMail = Nothing Set FSO= Server.CreateObject("Scripting.FileSystemObject")If Fso.FileExists(varanexo) ThenSet anexo = FSO.GetFile(varanexo)anexo.deleteend ifresponse.write("<script>location = '../SIM/PRINCIPALXYZ000.htm';alert('Sua mensagem foi enviada com sucesso!.')</script>")%>

FORMULARIO...

<!-- #include file = "funcoes_upload.asp" --><%byteCount = Request.TotalBytesRequestBin = Request.BinaryRead(byteCount)Set UploadRequest = CreateObject("Scripting.Dictionary")BuildUploadRequest RequestBinVcodigo = UploadRequest.Item("codigo").Item("Value")Vemail = UploadRequest.Item("email").Item("Value")Vwin = UploadRequest.Item("win").Item("Value")Vproc = UploadRequest.Item("proc").Item("Value")VversaoAUTO = UploadRequest.Item("versao").Item("Value")VSoftware = UploadRequest.Item("Software").Item("Value")Vversao = UploadRequest.Item("versao").Item("Value")Vrelease = UploadRequest.Item("release").Item("Value")Vtipo = UploadRequest.Item("tipo").Item("Value")Vduvida = UploadRequest.Item("duvida").Item("Value")tipo_arquivo = UploadRequest.Item("arquivo").Item("ContentType")caminho_arquivo = UploadRequest.Item("arquivo").Item("FileName")nome_arquivo = Right(caminho_arquivo,Len(caminho_arquivo)-InstrRev(caminho_arquivo,"\"))arquivo = UploadRequest.Item("arquivo").Item("Value")pasta = Server.MapPath("obras/")nome_arquivo = "/"&nome_arquivoVarquivo = "obras" + nome_arquivoif Varquivo <> "" thenSet ScriptObject = Server.CreateObject("Scripting.FileSystemObject")Set MyFile = ScriptObject.CreateTextFile(pasta & nome_arquivo)For i = 1 to LenB(arquivo)MyFile.Write chr(AscB(MidB(arquivo,i,1)))NextMyFile.Closeend ifanexar = falseIf arquivo <> "" Then   anexar = TrueEnd IfHTML = "<!DOCTYPE HTML PUBLIC ""-//IETF//DTD HTML//EN"">"HTML = HTML & "<html>"HTML = HTML & "<head>"HTML = HTML & "<meta http-equiv=""Content-Type""" HTML = HTML & "content=""text/html; charset=iso-8859-1"">" HTML = HTML & "<title>Contatos</title>" HTML = HTML & "</head>" HTML = HTML & "<B><font size=""4"" color=""#FF0000"" face=""arial""><div align=""center"">DÚVIDA ENVIADA ATRAVÉS DO SITE</div></font></tr></B><BR><HR><BR>"HTML = HTML & "<font size=""3"" face=""arial"">"HTML = HTML & "<B>Data de Envio da Dúvida: " & DATE() & "</B><BR><BR>"HTML = HTML & "<B>CODIGO SIM : </B>" & Vcodigo & "<BR>"HTML = HTML & "<B>Email : </B>" & Vemail & "<BR>"HTML = HTML & "<B>Windows : </B>" & Vwin & "<BR>"HTML = HTML & "<B>Processador : </B>" & Vproc & "<BR>"HTML = HTML & "<B>Versão do AUTO CAD: </B>" & VversaoAUTO & "<BR>"HTML = HTML & "<B>Software : </B>" & Vsoftware & "<BR>"HTML = HTML & "<B>Versão : </B>" & Vversao & "<BR>"HTML = HTML & "<B>Release : </B>" & Vrelease & "<BR>"HTML = HTML & "<B>Tipo da Dúvida : </B>" & Vtipo & "<BR>"HTML = HTML & "<B>Dúvida : </B>" & Vduvida & "<BR>"HTML = HTML & "</font>"HTML = HTML & "<B><BR><HR><HR><BR>"HTML = HTML & "<B><font size=""4"" color=""#FF0000"" face=""arial"">RESPOSTA DO TÉCNICO</font></B><BR><BR>"HTML = HTML & "<font size=""3"" face=""arial"">"HTML = HTML & "<B>Técnico Responsável:<B><BR>"HTML = HTML & "<B>Data de entrega:</B><BR>"HTML = HTML & "<B>Mensagem:<B>"HTML = HTML & "</font>"HTML = HTML & "</body>"HTML = HTML & "</html>"Server.ScriptTimeout = 100varanexo = Server.MapPath(Varquivo)Set myMail = CreateObject("CDONTS.NewMail") myMail.From = "SITE" myMail.To = "multitecnico@multiplus.com"myMail.Subject = "DÚVIDAS DO SIM - VIA SITE"myMail.BodyFormat = 0 myMail.MailFormat = 0If anexar Then   myMail.Attachfile "varanexo"End IfmyMail.Body = HTML myMail.Send Set myMail = Nothing Set FSO= Server.CreateObject("Scripting.FileSystemObject")If Fso.FileExists(varanexo) ThenSet anexo = FSO.GetFile(varanexo)anexo.deleteend ifresponse.write("<script>location = '../SIM/PRINCIPALXYZ000.htm';alert('Sua mensagem foi enviada com sucesso!.')</script>")%>

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.