
--Ludson--
Membros-
Total de itens
193 -
Registro em
-
Última visita
Tudo que --Ludson-- postou
-
valeu, vo tenta aki depois falo se deu certo!
-
realmente o foda de alguns programas é isso, eles inserem tags no seu código. mas pra quem ta começando a aprender é bom um editor visual como o frot page ou outros, o bloco de notas exige maior conhecimento dos códigos
-
tipo, pra você rodar asp no pc, tem q te instalado um servidor tipo Personal Web Server(eu uso este) não tem q cofigurar nada do front page só no PSW. procure tutoriais sobre PWS q te explicam direito!! flows
-
bom, vamos lá, vou tentar explicar melhor. Tipo eu criei um banco de dados chamado arquivos, neste banco de dados, criei duas tabelas, imagens e produtos. na tabela imagens, tenho os campos: ID, imgp e imgg. Na tabela produtos, tenho: ID, imgp, imgg, descricao, titulo bom, vamos ao sistema do álbum: vou usar um formulário para adicionar uma imagem pequena(imgp) e uma imagem grande(imgg) na tabela imagens. e vou usar um formulário para adicionar novos produtos no álbum. O formulário tem os seguintes campos: Titulo, Descrição, Imagem Grande, Imagem pequena. Bom, nos campos Imagem Grande e Imagem pequena, eu usei um campo do tipo <select>. o que eu desejo: exibir no campo Imagem pequena(<select> ) todas as imagens cadastradas na tabela imagens e no campo Imagem Grande, a mesma coisa. Eu criei uma conexão com bd, dentro do select chamei o resultado e criei um loop para exibir todos os campos, funcionou muito bem no primeiro campo, mas no segundo não aparece. Me ajudem!!!!!!!! é muito simples eu quero exibir todos os dados do campo imgp e criar um loop e depois exibir todos os dados do campo imgg e criar outro loop. é como se eu tivesse um cadastro com nomes e telefones, e criasse um sistema para exibir todos os nomes e depois todos os telefones tipo: Nome dos Clientes: Tiago Romeu Marcelo Marcos Critiane Luana Marcia tipo: Nomes dos Clientes: <%= rs("nomes")%> <% rs.MoveNext %> Telefones dos Clientes: <%= rs("telefones")%> <% rs.MoveNext %> Telefones dos Clientes 666-66666 6366-9315 666-4485 1123-4445 2264-8897 5564-4444 5568-4547 num entendeu^^??? não sei como explicar melhor q isso. valeu
-
Po cara, tipo eu trabalho com Front Page a mais d 2 anos, já tentei usa otros mas o q melhor me adaptei foi o FP.
-
Falae galera, ow to precisande de uma ajuda, tipo eu queria saber se tem como inserir imagens dinamicamente no flash, algo através de variaveis ou coisa assim,tipo, tem como pegar através de variável textos digitados em bloco de notas, asp, etc, tipo, tem como inserir imagem de um banco de dados desse jeito??? valeu
-
Falae galera, to precisando de um HELP, ainda to aprendendo asp, talvez essa seja uma pergunta meio idiota e de fácil solução, se puderem me ajudar, agradeço!!!! Bom vamos lá, eu criei um bd com os campos: imgp, imgg Bom, criei um sistema onde acesso um formulário para inclusão de imagens no bd, imagens estas que formarão um álbum. No formulário, eu tenho o campo imagem pequena e imagem grande, no campo imagem pequena, inseri um campo de seleção, onde neste campo, ele retorna a lista de imagens cadastradas no banco de dados. até aí tudo bem, mas o meu problema ta sendo o seguinte, no mesmo registro eu tenho imgp e imgg, e no formulário tenho dois campos, um para cada, os dois com as mesmas funções, a de retornar a lista de imagens cadastradas. o que eu preciso: saber como faço para que no campo de seleção, eu retorne o resultado da célula imgp e crie um loop q faça aparecer todos os registros dessa célula, e preciso fazer o mesmo com o campo imgg. fiz da seguinte maneira: <% cnpath="DBQ=" & Server.MapPath("bd/arquivos.mdb") DataSource = "Driver={Microsoft Access Driver (*.mdb)}; " & cnpath Set Conn = Server.CreateObject("ADODB.Connection") Conn.Open DataSource 'Abre o Recordset Set RS = Server.CreateObject( "ADODB.Recordset" ) RS.ActiveConnection = conn RS.open "SELECT * FROM imagens" %> <% if not rs.eof then while not rs.eof %> <select size="1" name="D1" style="font-family: Verdana; font-size: 8 pt; border: 1px solid #006699; background-color: #EAEAEA"> <option><%= rs("imgp") %></option> <% rs.Movenext wend end if %> </select></td> </tr> <tr> <td width="32%">Imagem grande</td> <td width="68%"> <select size="1" name="D2" style="font-family: Verdana; font-size: 8 pt; border: 1px solid #006699; background-color: #EAEAEA"> <% if not rs.eof then while not rs.eof %> <option><%= rs("imgg") %></option> <% rs.Movenext wend end if %> </select> tipo, o campo imgp funciona muito bem, mas no campo imgg não aparece nada, eu queria saber como faço pra aparecer no campo imgg sem que eu tenha que fechar e abrir novamente a conexão. não sei se deu pra entender direito. mas se puderem me ajudar agradeço!!!!
-
Cara eu tva procurando um código que tipo, listasse as imagens da pasta imagens e exibisse no conteúdo da página. Não achei nada, mas tipo, não so muito bom em asp, mas tipo, acho q da pra faze de forma bem simples mas com trabalho. Cria um banco de dados, e tipo, no banco de dados você coloca o nome da imagem, tipo: imagem.jpg na pagina você cria uma conexão co bd e chama a imagem, tipo <img src="pasta/<%= rs(imagem)%>"> pra exibir essa imagem em otra página, tipo cria um link: <a href="outra_pagina.asp?id=<%= rs("id")%>"><img src="pasta/<%= rs(imagem)%>"></a> Aí na outra página você cria uma conexão que exiba apenas a imagem correspondente a ID indicada no QueryString se falei bobera me desculpem e me corrijam. Flows!!!
-
po cara, não entendi nada, tipo o q você que? exibi os dados da tabela por uma célula específica?? não entendi fera.
-
Aí cara, se você souber usar asp e seu site tive num servidor com suporte, procura no aqui no Script Brasil mesmo que você vai acha o Chacal Banners, tipo, eu uso ele, é bom, tem contagem de cliques, quantas vezes foi exibido e área para adicionar e excluir banners, tem suporte a jpg, gif, e swf(flash). Agora se não tive o servidor com suporte ou não souber como usar, no site www.wmonline.com.br tem um sistema gratuito de banners rotativos, é bom e fácil de usa. Flow.
-
Tipo, a pasta que ta as imagens é: C:/Inetpub/wwwroot/imagens. Cria uma conexão com o BD: <% cnpath="DBQ=" & Server.MapPath("banco.mdb") DataSource = "Driver={Microsoft Access Driver (*.mdb)}; " & cnpath Set Conn = Server.CreateObject("ADODB.Connection") Conn.Open DataSource 'Abre o Recordset Set RS = Server.CreateObject( "ADODB.Recordset" ) RS.ActiveConnection = conn set rs=conn.execute("select * from tabela") %> aí pra exibir a imagem, é só você colocar na página onde você quer, tipo, se no campo do banco de dados você digita o nome da imagem da seguinte maneira: "imagens/imagem.jpg", você insere na página: <img src="<%= rs("imagem")%>"> agora se no seu banco de dados você só coloca o nome e a extensão da imagem: "figura.jpg" pra imagem aparecer na página você tem q coloca: <img src="imagens/<%= rs("imagem")%>"> Tipo, nem testei o código, testa aí depois me fala se funciono.
-
Ae galera, eu achei um sistema de upload sem componentes, e funcionou perfeitamente no meu PSW. bom são duas páginas, uma com os formulários para fazer o upload e outra com o script para carregar o arquivo para a pasta desejada, aí vai: página: formulario.asp <%@ Language=VBScript %> <% option explicit Response.Expires = -1 Server.ScriptTimeout = 600 %> <!-- #include file="freeaspupload.asp" --> <% ' **************************************************** ' Change the value of the variable below to the pathname ' of a directory with write permissions, for example "C:\Inetpub\wwwroot" Dim uploadsDirVar uploadsDirVar = "D:\pasta\codigos e tutoriais\Códigos\ASP\Sistema de Upload\" ' **************************************************** ' Note: this file uploadTester.asp is just an example to demonstrate ' the capabilities of the freeASPUpload.asp class. There are no plans ' to add any new features to uploadTester.asp itself. Feel free to add ' your own code. If you are building a content management system, you ' may also want to consider this script: http://www.webfilebrowser.com/ function OutputForm() %> <form name="frmSend" method="POST" enctype="multipart/form-data" action="uploadTester.asp" onSubmit="return onSubmitForm();"> File 1: <input name=attach1 type=file size=35><br> File 2: <input name=attach2 type=file size=35><br> File 3: <input name=attach3 type=file size=35><br> File 4: <input name=attach4 type=file size=35><br> <br> <input style="margin-top:4" type=submit value="Upload"> </form> <% end function function TestEnvironment() Dim fso, fileName, testFile, streamTest TestEnvironment = "" Set fso = Server.CreateObject("Scripting.FileSystemObject") if not fso.FolderExists(uploadsDirVar) then TestEnvironment = "<B>Folder " & uploadsDirVar & " does not exist.</B><br>The value of your uploadsDirVar is incorrect. Open uploadTester.asp in an editor and change the value of uploadsDirVar to the pathname of a directory with write permissions." exit function end if fileName = uploadsDirVar & "\test.txt" on error resume next Set testFile = fso.CreateTextFile(fileName, true) If Err.Number<>0 then TestEnvironment = "<B>Folder " & uploadsDirVar & " does not have write permissions.</B><br>The value of your uploadsDirVar is incorrect. Open uploadTester.asp in an editor and change the value of uploadsDirVar to the pathname of a directory with write permissions." exit function end if Err.Clear testFile.Close fso.DeleteFile(fileName) If Err.Number<>0 then TestEnvironment = "<B>Folder " & uploadsDirVar & " does not have delete permissions</B>, although it does have write permissions.<br>Change the permissions for IUSR_<I>computername</I> on this folder." exit function end if Err.Clear Set streamTest = Server.CreateObject("ADODB.Stream") If Err.Number<>0 then TestEnvironment = "<B>The ADODB object <I>Stream</I> is not available in your server.</B><br>Check the Requirements page for information about upgrading your ADODB libraries." exit function end if Set streamTest = Nothing end function function SaveFiles Dim Upload, fileName, fileSize, ks, i, fileKey Set Upload = New FreeASPUpload Upload.Save(uploadsDirVar) SaveFiles = "" ks = Upload.UploadedFiles.keys if (UBound(ks) <> -1) then SaveFiles = "<B>Files uploaded:</B> " for each fileKey in Upload.UploadedFiles.keys SaveFiles = SaveFiles & Upload.UploadedFiles(fileKey).FileName & " (" & Upload.UploadedFiles(fileKey).Length & "B) " next else SaveFiles = "The file name specified in the upload form does not correspond to a valid file in the system." end if end function %> <HTML> <HEAD> <TITLE>Test Free ASP Upload</TITLE> <style> BODY {background-color: white;font-family:arial; font-size:12} </style> <script> function onSubmitForm() { var formDOMObj = document.frmSend; if (formDOMObj.attach1.value == "" && formDOMObj.attach2.value == "" && formDOMObj.attach3.value == "" && formDOMObj.attach4.value == "" ) alert("Please press the browse button and pick a file.") else return true; return false; } </script> </HEAD> <BODY> <br><br> <div style="border-bottom: #A91905 2px solid;font-size:16">Upload files to your server</div> <% Dim diagnostics if Request.ServerVariables("REQUEST_METHOD") <> "POST" then diagnostics = TestEnvironment() if diagnostics<>"" then response.write "<div style=""margin-left:20; margin-top:30; margin-right:30; margin-bottom:30;"">" response.write diagnostics response.write "<p>After you correct this problem, reload the page." response.write "</div>" else response.write "<div style=""margin-left:150"">" OutputForm() response.write "</div>" end if else response.write "<div style=""margin-left:150"">" OutputForm() response.write SaveFiles() response.write "<br><br></div>" end if %> <div style="border-top: #A91905 2px solid;font-size:10">Powered by <A HREF="http://www.freeaspupload.net/" style="color:black">Free ASP Upload</A></div> </BODY> </HTML> página: freeASPupload.asp <% ' For examples, documentation, and your own free copy, go to: ' http://www.freeaspupload.net ' Note: You can copy and use this script for free and you can make changes ' to the code, but you cannot remove the above comment. Class FreeASPUpload Public UploadedFiles Public FormElements Private VarArrayBinRequest Private StreamRequest Private uploadedYet Private Sub Class_Initialize() Set UploadedFiles = Server.CreateObject("Scripting.Dictionary") Set FormElements = Server.CreateObject("Scripting.Dictionary") Set StreamRequest = Server.CreateObject("ADODB.Stream") StreamRequest.Type = 1 'adTypeBinary StreamRequest.Open uploadedYet = false End Sub Private Sub Class_Terminate() If IsObject(UploadedFiles) Then UploadedFiles.RemoveAll() Set UploadedFiles = Nothing End If If IsObject(FormElements) Then FormElements.RemoveAll() Set FormElements = Nothing End If StreamRequest.Close Set StreamRequest = Nothing End Sub Public Property Get Form(sIndex) Form = "" If FormElements.Exists(LCase(sIndex)) Then Form = FormElements.Item(LCase(sIndex)) End Property Public Property Get Files() Files = UploadedFiles.Items End Property 'Calls Upload to extract the data from the binary request and then saves the uploaded files Public Sub Save(path) Dim streamFile, fileItem if Right(path, 1) <> "\" then path = path & "\" if not uploadedYet then Upload For Each fileItem In UploadedFiles.Items Set streamFile = Server.CreateObject("ADODB.Stream") streamFile.Type = 1 streamFile.Open StreamRequest.Position=fileItem.Start StreamRequest.CopyTo streamFile, fileItem.Length streamFile.SaveToFile path & fileItem.FileName, 2 streamFile.close Set streamFile = Nothing fileItem.Path = path & fileItem.FileName Next End Sub Public Sub DumpData() 'only works if files are plain text Dim i, aKeys, f response.write "Form Items:<br>" aKeys = FormElements.Keys For i = 0 To FormElements.Count -1 ' Iterate the array response.write aKeys(i) & " = " & FormElements.Item(aKeys(i)) & "<BR>" Next response.write "Uploaded Files:<br>" For Each f In UploadedFiles.Items response.write "Name: " & f.FileName & "<br>" response.write "Type: " & f.ContentType & "<br>" response.write "Start: " & f.Start & "<br>" response.write "Size: " & f.Length & "<br>" Next End Sub Private Sub Upload() Dim nCurPos, nDataBoundPos, nLastSepPos Dim nPosFile, nPosBound Dim sFieldName 'RFC1867 Tokens Dim vDataSep Dim tNewLine, tDoubleQuotes, tTerm, tFilename, tName, tContentDisp, tContentType tNewLine = Byte2String(Chr(13)) tDoubleQuotes = Byte2String(Chr(34)) tTerm = Byte2String("--") tFilename = Byte2String("filename=""") tName = Byte2String("name=""") tContentDisp = Byte2String("Content-Disposition") tContentType = Byte2String("Content-Type:") uploadedYet = true VarArrayBinRequest = Request.BinaryRead(Request.TotalBytes) nCurPos = FindToken(tNewLine,1) 'Note: nCurPos is 1-based (and so is InstrB, MidB, etc) If nCurPos <= 1 Then Exit Sub 'vDataSep is a separator like -----------------------------21763138716045 vDataSep = MidB(VarArrayBinRequest, 1, nCurPos-1) 'Start of current separator nDataBoundPos = 1 'Beginning of last line nLastSepPos = FindToken(vDataSep & tTerm, 1) Do Until nDataBoundPos = nLastSepPos nCurPos = SkipToken(tContentDisp, nDataBoundPos) nCurPos = SkipToken(tName, nCurPos) sFieldName = ExtractField(tDoubleQuotes, nCurPos) nPosFile = FindToken(tFilename, nCurPos) nPosBound = FindToken(vDataSep, nCurPos) If nPosFile <> 0 And nPosFile < nPosBound Then Dim oUploadFile, sFileName Set oUploadFile = New UploadedFile nCurPos = SkipToken(tFilename, nCurPos) sFileName = ExtractField(tDoubleQuotes, nCurPos) oUploadFile.FileName = Right(sFileName, Len(sFileName)-InStrRev(sFileName, "\")) if (Len(oUploadFile.FileName) > 0) then 'File field not left empy nCurPos = SkipToken(tContentType, nCurPos) oUploadFile.ContentType = ExtractField(tNewLine, nCurPos) nCurPos = FindToken(tNewLine, nCurPos) + 4 'skip empty line oUploadFile.Start = nCurPos-1 oUploadFile.Length = FindToken(vDataSep, nCurPos) - 2 - nCurPos If oUploadFile.Length > 0 Then UploadedFiles.Add LCase(sFieldName), oUploadFile End If Else Dim nEndOfData nCurPos = FindToken(tNewLine, nCurPos) + 4 'skip empty line nEndOfData = FindToken(vDataSep, nCurPos) - 2 If Not FormElements.Exists(LCase(sFieldName)) Then FormElements.Add LCase(sFieldName), String2Byte(MidB(VarArrayBinRequest, nCurPos, nEndOfData-nCurPos)) End If 'Advance to next separator nDataBoundPos = FindToken(vDataSep, nCurPos) Loop StreamRequest.Write(VarArrayBinRequest) End Sub Private Function SkipToken(sToken, nStart) SkipToken = InstrB(nStart, VarArrayBinRequest, sToken) If SkipToken = 0 then Response.write "Error in parsing uploaded binary request." Response.End end if SkipToken = SkipToken + LenB(sToken) End Function Private Function FindToken(sToken, nStart) FindToken = InstrB(nStart, VarArrayBinRequest, sToken) End Function Private Function ExtractField(sToken, nStart) Dim nEnd nEnd = InstrB(nStart, VarArrayBinRequest, sToken) If nEnd = 0 then Response.write "Error in parsing uploaded binary request." Response.End end if ExtractField = String2Byte(MidB(VarArrayBinRequest, nStart, nEnd-nStart)) End Function Public Function SaveBinRequest(path) ' For debugging purposes StreamRequest.SaveToFile path & "debugStream.bin", 2 End Function 'String to byte string conversion Private Function Byte2String(sString) Dim i For i = 1 to Len(sString) Byte2String = Byte2String & ChrB(AscB(Mid(sString,i,1))) Next End Function 'Byte string to string conversion Private Function String2Byte(bsString) Dim i String2Byte ="" For i = 1 to LenB(bsString) String2Byte = String2Byte & Chr(AscB(MidB(bsString,i,1))) Next End Function End Class Class UploadedFile Public ContentType Public FileName Public Start Public Length Public Path End Class %> Pra quem ta afim de faze o download do código pronto, ta o link aí: http://www.otaw.cjb.net//sisupload.zip Ta aí galera, tipo, no meu pc funciono muito bem, espero ter ajudado!!!!!! Flows!
-
beleza vo posta lá
-
bom, é muito simples, pelo menos faço assim não sei se tem outro geito. você pode selecionar todo o banner e clicar em F8(criar novo simbolo), vai abrir uma caixa de diálogo com as opçoes: Clipe de filme Botão Gráfico você seleciona a opção botão e dá um nome pro novo símbolo. depois é só inserir uma ação no botão q acabou de criar, tipo, clica com o botão direito em cima do banner, e clica em ações, depois é só procurar nas ações básicas, a ação "get url" aí é só digita o endereço q você q q o banner abre e pronto!!!!!!! Flows!!!
-
tipo, coloquei o arquivo zipado pra download, se preferir vai ser mais fácil de usar e aprender: http://www.otaw.cjb.net//sisupload.zip Qualque coisa tamu aí.
-
Ae galera, eu achei um sistema de upload sem componentes, e funcionou perfeitamente no meu PSW. Sei que você são contra postar códigos prontos nos fóruns, mas achu q num da nada, porque não fui eu q fiz o código, eu baixei de algum lugar, mas não lembro de onde, mas no código tem o link do autor e os Direitos Reservados. bom são duas páginas, uma com os formulários para fazer o upload e outra com o script para carregar o arquivo para a pasta desejada, aí vai: página: formulario.asp <%@ Language=VBScript %> <% option explicit Response.Expires = -1 Server.ScriptTimeout = 600 %> <!-- #include file="freeaspupload.asp" --> <% ' **************************************************** ' Change the value of the variable below to the pathname ' of a directory with write permissions, for example "C:\Inetpub\wwwroot" Dim uploadsDirVar uploadsDirVar = "D:\pasta\codigos e tutoriais\Códigos\ASP\Sistema de Upload\" ' **************************************************** ' Note: this file uploadTester.asp is just an example to demonstrate ' the capabilities of the freeASPUpload.asp class. There are no plans ' to add any new features to uploadTester.asp itself. Feel free to add ' your own code. If you are building a content management system, you ' may also want to consider this script: http://www.webfilebrowser.com/ function OutputForm() %> <form name="frmSend" method="POST" enctype="multipart/form-data" action="uploadTester.asp" onSubmit="return onSubmitForm();"> File 1: <input name=attach1 type=file size=35><br> File 2: <input name=attach2 type=file size=35><br> File 3: <input name=attach3 type=file size=35><br> File 4: <input name=attach4 type=file size=35><br> <br> <input style="margin-top:4" type=submit value="Upload"> </form> <% end function function TestEnvironment() Dim fso, fileName, testFile, streamTest TestEnvironment = "" Set fso = Server.CreateObject("Scripting.FileSystemObject") if not fso.FolderExists(uploadsDirVar) then TestEnvironment = "<B>Folder " & uploadsDirVar & " does not exist.</B><br>The value of your uploadsDirVar is incorrect. Open uploadTester.asp in an editor and change the value of uploadsDirVar to the pathname of a directory with write permissions." exit function end if fileName = uploadsDirVar & "\test.txt" on error resume next Set testFile = fso.CreateTextFile(fileName, true) If Err.Number<>0 then TestEnvironment = "<B>Folder " & uploadsDirVar & " does not have write permissions.</B><br>The value of your uploadsDirVar is incorrect. Open uploadTester.asp in an editor and change the value of uploadsDirVar to the pathname of a directory with write permissions." exit function end if Err.Clear testFile.Close fso.DeleteFile(fileName) If Err.Number<>0 then TestEnvironment = "<B>Folder " & uploadsDirVar & " does not have delete permissions</B>, although it does have write permissions.<br>Change the permissions for IUSR_<I>computername</I> on this folder." exit function end if Err.Clear Set streamTest = Server.CreateObject("ADODB.Stream") If Err.Number<>0 then TestEnvironment = "<B>The ADODB object <I>Stream</I> is not available in your server.</B><br>Check the Requirements page for information about upgrading your ADODB libraries." exit function end if Set streamTest = Nothing end function function SaveFiles Dim Upload, fileName, fileSize, ks, i, fileKey Set Upload = New FreeASPUpload Upload.Save(uploadsDirVar) SaveFiles = "" ks = Upload.UploadedFiles.keys if (UBound(ks) <> -1) then SaveFiles = "<B>Files uploaded:</B> " for each fileKey in Upload.UploadedFiles.keys SaveFiles = SaveFiles & Upload.UploadedFiles(fileKey).FileName & " (" & Upload.UploadedFiles(fileKey).Length & "B) " next else SaveFiles = "The file name specified in the upload form does not correspond to a valid file in the system." end if end function %> <HTML> <HEAD> <TITLE>Test Free ASP Upload</TITLE> <style> BODY {background-color: white;font-family:arial; font-size:12} </style> <script> function onSubmitForm() { var formDOMObj = document.frmSend; if (formDOMObj.attach1.value == "" && formDOMObj.attach2.value == "" && formDOMObj.attach3.value == "" && formDOMObj.attach4.value == "" ) alert("Please press the browse button and pick a file.") else return true; return false; } </script> </HEAD> <BODY> <br><br> <div style="border-bottom: #A91905 2px solid;font-size:16">Upload files to your server</div> <% Dim diagnostics if Request.ServerVariables("REQUEST_METHOD") <> "POST" then diagnostics = TestEnvironment() if diagnostics<>"" then response.write "<div style=""margin-left:20; margin-top:30; margin-right:30; margin-bottom:30;"">" response.write diagnostics response.write "<p>After you correct this problem, reload the page." response.write "</div>" else response.write "<div style=""margin-left:150"">" OutputForm() response.write "</div>" end if else response.write "<div style=""margin-left:150"">" OutputForm() response.write SaveFiles() response.write "<br><br></div>" end if %> <div style="border-top: #A91905 2px solid;font-size:10">Powered by <A HREF="http://www.freeaspupload.net/" style="color:black">Free ASP Upload</A></div> </BODY> </HTML> página: freeASPupload.asp <% ' For examples, documentation, and your own free copy, go to: ' http://www.freeaspupload.net ' Note: You can copy and use this script for free and you can make changes ' to the code, but you cannot remove the above comment. Class FreeASPUpload Public UploadedFiles Public FormElements Private VarArrayBinRequest Private StreamRequest Private uploadedYet Private Sub Class_Initialize() Set UploadedFiles = Server.CreateObject("Scripting.Dictionary") Set FormElements = Server.CreateObject("Scripting.Dictionary") Set StreamRequest = Server.CreateObject("ADODB.Stream") StreamRequest.Type = 1 'adTypeBinary StreamRequest.Open uploadedYet = false End Sub Private Sub Class_Terminate() If IsObject(UploadedFiles) Then UploadedFiles.RemoveAll() Set UploadedFiles = Nothing End If If IsObject(FormElements) Then FormElements.RemoveAll() Set FormElements = Nothing End If StreamRequest.Close Set StreamRequest = Nothing End Sub Public Property Get Form(sIndex) Form = "" If FormElements.Exists(LCase(sIndex)) Then Form = FormElements.Item(LCase(sIndex)) End Property Public Property Get Files() Files = UploadedFiles.Items End Property 'Calls Upload to extract the data from the binary request and then saves the uploaded files Public Sub Save(path) Dim streamFile, fileItem if Right(path, 1) <> "\" then path = path & "\" if not uploadedYet then Upload For Each fileItem In UploadedFiles.Items Set streamFile = Server.CreateObject("ADODB.Stream") streamFile.Type = 1 streamFile.Open StreamRequest.Position=fileItem.Start StreamRequest.CopyTo streamFile, fileItem.Length streamFile.SaveToFile path & fileItem.FileName, 2 streamFile.close Set streamFile = Nothing fileItem.Path = path & fileItem.FileName Next End Sub Public Sub DumpData() 'only works if files are plain text Dim i, aKeys, f response.write "Form Items:<br>" aKeys = FormElements.Keys For i = 0 To FormElements.Count -1 ' Iterate the array response.write aKeys(i) & " = " & FormElements.Item(aKeys(i)) & "<BR>" Next response.write "Uploaded Files:<br>" For Each f In UploadedFiles.Items response.write "Name: " & f.FileName & "<br>" response.write "Type: " & f.ContentType & "<br>" response.write "Start: " & f.Start & "<br>" response.write "Size: " & f.Length & "<br>" Next End Sub Private Sub Upload() Dim nCurPos, nDataBoundPos, nLastSepPos Dim nPosFile, nPosBound Dim sFieldName 'RFC1867 Tokens Dim vDataSep Dim tNewLine, tDoubleQuotes, tTerm, tFilename, tName, tContentDisp, tContentType tNewLine = Byte2String(Chr(13)) tDoubleQuotes = Byte2String(Chr(34)) tTerm = Byte2String("--") tFilename = Byte2String("filename=""") tName = Byte2String("name=""") tContentDisp = Byte2String("Content-Disposition") tContentType = Byte2String("Content-Type:") uploadedYet = true VarArrayBinRequest = Request.BinaryRead(Request.TotalBytes) nCurPos = FindToken(tNewLine,1) 'Note: nCurPos is 1-based (and so is InstrB, MidB, etc) If nCurPos <= 1 Then Exit Sub 'vDataSep is a separator like -----------------------------21763138716045 vDataSep = MidB(VarArrayBinRequest, 1, nCurPos-1) 'Start of current separator nDataBoundPos = 1 'Beginning of last line nLastSepPos = FindToken(vDataSep & tTerm, 1) Do Until nDataBoundPos = nLastSepPos nCurPos = SkipToken(tContentDisp, nDataBoundPos) nCurPos = SkipToken(tName, nCurPos) sFieldName = ExtractField(tDoubleQuotes, nCurPos) nPosFile = FindToken(tFilename, nCurPos) nPosBound = FindToken(vDataSep, nCurPos) If nPosFile <> 0 And nPosFile < nPosBound Then Dim oUploadFile, sFileName Set oUploadFile = New UploadedFile nCurPos = SkipToken(tFilename, nCurPos) sFileName = ExtractField(tDoubleQuotes, nCurPos) oUploadFile.FileName = Right(sFileName, Len(sFileName)-InStrRev(sFileName, "\")) if (Len(oUploadFile.FileName) > 0) then 'File field not left empy nCurPos = SkipToken(tContentType, nCurPos) oUploadFile.ContentType = ExtractField(tNewLine, nCurPos) nCurPos = FindToken(tNewLine, nCurPos) + 4 'skip empty line oUploadFile.Start = nCurPos-1 oUploadFile.Length = FindToken(vDataSep, nCurPos) - 2 - nCurPos If oUploadFile.Length > 0 Then UploadedFiles.Add LCase(sFieldName), oUploadFile End If Else Dim nEndOfData nCurPos = FindToken(tNewLine, nCurPos) + 4 'skip empty line nEndOfData = FindToken(vDataSep, nCurPos) - 2 If Not FormElements.Exists(LCase(sFieldName)) Then FormElements.Add LCase(sFieldName), String2Byte(MidB(VarArrayBinRequest, nCurPos, nEndOfData-nCurPos)) End If 'Advance to next separator nDataBoundPos = FindToken(vDataSep, nCurPos) Loop StreamRequest.Write(VarArrayBinRequest) End Sub Private Function SkipToken(sToken, nStart) SkipToken = InstrB(nStart, VarArrayBinRequest, sToken) If SkipToken = 0 then Response.write "Error in parsing uploaded binary request." Response.End end if SkipToken = SkipToken + LenB(sToken) End Function Private Function FindToken(sToken, nStart) FindToken = InstrB(nStart, VarArrayBinRequest, sToken) End Function Private Function ExtractField(sToken, nStart) Dim nEnd nEnd = InstrB(nStart, VarArrayBinRequest, sToken) If nEnd = 0 then Response.write "Error in parsing uploaded binary request." Response.End end if ExtractField = String2Byte(MidB(VarArrayBinRequest, nStart, nEnd-nStart)) End Function Public Function SaveBinRequest(path) ' For debugging purposes StreamRequest.SaveToFile path & "debugStream.bin", 2 End Function 'String to byte string conversion Private Function Byte2String(sString) Dim i For i = 1 to Len(sString) Byte2String = Byte2String & ChrB(AscB(Mid(sString,i,1))) Next End Function 'Byte string to string conversion Private Function String2Byte(bsString) Dim i String2Byte ="" For i = 1 to LenB(bsString) String2Byte = String2Byte & Chr(AscB(MidB(bsString,i,1))) Next End Function End Class Class UploadedFile Public ContentType Public FileName Public Start Public Length Public Path End Class %> Ta aí galera, tipo, no meu pc funciono muito bem, espero ter ajudado!!!!!! Flows!
-
Ae galera, o mesmo foi resolvido, achu que devia ser algum erro no servidor de hospedagem, porque o mesmo foi solucionado sozinho!!! Vlew pela força!!!
-
Microsoft OLE DB Provider for ODBC Drivers error '8007000e' [Microsoft][ODBC Microsoft Access Driver] System resource exceeded. em alguns scripts asp no meu servidor de hospedagem ta aparecendo esse erro, o q vem a ser????? Vlew
-
como digo nos meus posts de resposta, não sei se ta certo mais tenta fazer da seguinte maneira: Tipo dentro do seu asp, crie um "sei lá o nome" hehheheheh dexa eu explica, coloca dentro da pagina o código: <% IF Request.QueryString("form") = "entrar" then %> Aqui você cria o código que ve se a senha foi digitada ou não <% End IF %> tipo no campo form você coloca: <form action="pagina.asp?form=entrar" ...> como pra acessar o código entre <% ELSE IF ...%> e <% END IF%> precisa te digitado na barra de endereço o Request.QueryString, se entra na pagina.asp, o código que verifica se a senha foi digitada não vai rodar na entrada mas só se você acessar pelo form "POR FAVOR MODERADORES, ME CORRIJAM SE EU ESTIVER ERRADO!!!!"
-
Vleu galera!!!! Seis é os cara meu, quando meu site tive pronto eu passo pra vocês darem uma analisada!!!! Vleu, qualque coisa pergunto dinovo!!!!!! Flows
-
tipo, você pode criar uma página tipo "delete.asp" e colocar uma função que busque a id do recado na tabela Recados através de um Request.QueryString Na conexão com o BD em vez de colocar: delete * from Recados where id="&Request.querystring("id")&"" não so muito bom nesses assuntos, nem sei direito se ta correto, se estiver errado alguém me corrija porque aí já aprendo direito, mas tipo acho q é por aí!. Flows!!!
-
Tipo, o codigo é o seguinte: 1- <% 2- cnpath="DBQ=" & Server.MapPath("noticias.mdb") 3- DataSource = "Driver={Microsoft Access Driver (*.mdb)}; " & cnpath 4- 5- Set Conn = Server.CreateObject("ADODB.Connection") 6- 7- Conn.Open DataSource 8- 9- Set RS = Server.CreateObject( "ADODB.Recordset" ) 10- RS.ActiveConnection = conn 11- set rs=conn.execute("select*from Noticias where id="&request.querystring("id")&"") 12- %> 13- 14- <table width="45%" border="1" cellspacing="0" cellpadding="0" bordercolor="#333333"> 15- <tr> 16- <td bgcolor="#666666"><font size="4" color="#FFFFFF"><b><%=rs("manchete")%></b></font> </td> 17- </tr> 18- <tr> 19- <td bgcolor="#CCCCCC"> 20- <table width="100%" border="0" cellspacing="0" cellpadding="0"> 21- <tr> 22- <td> 23- <div align="center"><img src="<%=rs("imagem")%>" border=0></div> 24- </td> 25- </tr> 26- <tr> 27- <td><%=rs("noticia")%></td> 28- </tr> 29- </table> 30- </td> 31- </tr> 32- <tr> 33- <td bgcolor="#CCCCCC"><font size="1" face="Verdana, Arial, Helvetica, sans-serif">Fonte:<%=rs("fonte")%></font></td> 24- </tr> 35- </table> O código que chama a imagem do banco de dados ta na linha 23, tipo, se no BD não tiver nenhuma imagem no campo "imagem" eu gostaria que não aparecesse nada. Sei como chamar uma imagem do BD, mas se não tiver nenhuma imagem, fica aquela imagem de erro de caminho. Gostaria que ficasse em branco, espaço vazio caso não tenha nada no campo "imagem". Vlew
-
ae galera, to precisando de uma forcinha aí. Vo faze um sistema de notícias, e tipo, na notícia poderá conter imagem mas caso não tenha imagem eu gostaria que não aparecesse nada. Tipo uma função "ELSE" ou coisa assim, não sei direito como funciona. Como devo fazer???? é como se fosse uma consulta no banco de dados e quando não tem nada retorna um: "nenhum registro para exibir" em vez de aparecer isso, tipo não aparece nenhuma imagem, e se tiver a imagem ela apareçe!! se puderem me ensinar ou me da uma luz agradeço!!!!!!
-
Aproveitando q eu tva por aqui resolvi fazer mais uma pergunta, e se puderem me ajudar, vou tentar entender!!!! Eu tb precisava de um código que contasse o número de registro de um determinado campo da tabela, por exemplo: Tenho uma tabela onde vou cadastrar anúncios, nessa tabela tenho o campo categoria, onde possuo várias categorias, como (carros, motos, caminhões) eu gostaria de um código que contasse qntos registros tem na tabela que fazem parte da categoria carros por exemplo. Se puderem me ajudar agradeço.!
-
Po vleu pela tentativa de ajuda galera, mas num consegui resolver meu problema, dxa pra lá tento faze de algum outro jeito mais rústico, manual. Mas vleu pela força!!!!