Ir para conteúdo

POWERED BY:

Arquivado

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

zanelati2002

tentando cadastrar

Recommended Posts

o upload da foto é realizado, mas o nome com a extenção que deveria ficar no banco, não grava o que esta acontecendo olhem o codigo..

 

<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /><title>Untitled Document</title></head><body><%db = server.MapPath ("bd\luxuria.mdb")set con = server.CreateObject("adodb.connection")con.open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & server.mappath("..\..\..\bd\luxuria.mdb") &";Persist Security Info=False"server.scripttimeout=10000 On Error Resume Next Set mySmartUpload = Server.CreateObject("aspSmartUpload.SmartUpload") mySmartUpload.AllowedFilesList = "jpg," mySmartUpload.MaxFileSize = 200000 mySmartUpload.TotalMaxFileSize = 50000 mySmartUpload.Upload response.write(mySmartUpload.form("nome"))response.write(mySmartUpload.form("foto"))For each file In mySmartUpload.FilesIf not file.IsMissing Thenfile.SaveAs("../fotos/" & file.FileName)End IfNext If Err.number>0 ThenResponse.Write("<p><br><br>Um dos seguintes erros aconteceu: você tentou subir um arquivo cuja terminação não é GIF nem JPG. Ou então a imagem que você subiu é maior que 8.000 bytes(8 kb. ). A operação foi cancelada. Por favor tente de novo. ")response.endEnd If if err=0 thennome=(mySmartUpload.form("nome"))foto=(mySmartUpload.form("foto"))Sql = "INSERT INTO foto (legenda, foto)"Sql = Sql & "VALUES('" & nome & "', '" & foto & "')" con.Execute(Sql)Cadastrado = Trueresponse.Write("<div align='center'><font size='2' face='Verdana, Arial, Helvetica, sans-serif'><strong><font size='3'>Cadastro realizado com sucesso!</font></strong><br><br><em><a href='login.asp'>Efetuar login</a></em></font></div>")Response.Endelseresponse.Write("<div align='center'><font size='2' face='Verdana, Arial, Helvetica, sans-serif'><strong><font size='3'>Ocorreu algum erro durante o cadastro.</font></strong><br>Para maiores informações contate o webmaster.</font></div>")Response.EndEND IF%></body></html>

Compartilhar este post


Link para o post
Compartilhar em outros sites

Cara nunca usei o Smart Upload, mas o nome do arquivo está nessa linha:file.SaveAs("../fotos/" & file.FileName)então tentao colocar x = file.FileNamee insere X .. não sei se vai funcionar ... O que esta sendo carregado nas variaveis nome e foto?

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.