Ir para conteúdo

POWERED BY:

Arquivado

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

andre_re

Mostrar imagens direto de uma pasta

Recommended Posts

Oh rapazida..é o seguinte, tem como, você cria uma pagina, ae você aponta uma pasta, e na pagina aparece as imagens da pasta com o tamanho reduzido com paginação e link pra pop up?tem como isso pessoal?valeu até mais.

Compartilhar este post


Link para o post
Compartilhar em outros sites

Acho que isso pode te ajudar.

preste atenção no caminho da pasta das imagens.

flw.

 

 

<%@ Language=VBScript %><% Option Explicit %><%Const ImageFilePath = "caminho_fisico/fotos"Const DeleteButtonLabel = "Excluir imagens marcadas"Dim objFSODim objFolderDim objFileDim strFileNameDim strFileExtensionDim blnShowImagesIf Request.QueryString("ShowImages") = "" Then	blnShowImages = FalseElse	blnShowImages = CBool(Request.QueryString("ShowImages"))End IfIf Request.Form("btnDelete") = DeleteButtonLabel Then	Set objFSO = Server.CreateObject("Scripting.FileSystemObject")	For Each strFileName In Request.Form("delete")		objFSO.DeleteFile(ImageFilePath & "/" & _			strFileName)	Next	Set objFSO = NothingEnd If%><html><head>  <title>ListList</title>  <style type="text/css"><!--.style9 {font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 10px;}a:link {	color: #666666;	text-decoration: none;}a:visited {	text-decoration: none;	color: #666666;}a:hover {	text-decoration: none;	color: #FF0000;}a:active {	text-decoration: none;	color: #666666;}-->  </style><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"></head><body><form action="<%= Request.ServerVariables("URL") %>?id=imagens&codigo=010203" method="post"><table width="100%" border="0" cellpadding=0 cellspacing=2 bordercolor=#0000FF bordercolorlight=silver bordercolordark=White><tr bgcolor=gainsboro>	<th><span class="style9">Nome da imagem</span></th>	<th><span class="style9">Imagem <a href="<%= Request.ServerVariables("URL") %>?ShowImages=<%= Not blnShowImages %>&id=imagens&codigo=010203">(Mostrar/Esconder)</a></span></th>	<th><span class="style9">Excluir</span></th></tr><%Set objFSO = Server.CreateObject("Scripting.FileSystemObject")Set objFolder = objFSO.GetFolder(ImageFilePath)For Each objFile In objFolder.Files	strFileExtension = LCase(Mid(objFile.Name, _		InStrRev(objFile.Name, ".", -1, 1) + 1))	If strFileExtension = "gif" Or strFileExtension = "jpg" Or _		strFileExtension = "jpeg" Then		%>		<tr>		<td bgcolor="#E6E6E6" class="style9">			<div align="center">			<%= objFile.Name %></div></td>		<%		If blnShowImages Then			%>			<td bgcolor="#E6E6E6" class="style9">				<div align="center"><img src="http://www.visualoutdoor.com.br/placas_foto/fotos/<%=objFile.Name %>" />			</div></td>			<%		Else			%>			<td bgcolor="#E6E6E6" class="style9">				<div align="center"><a href="http://www.visualoutdoor.com.br/placas_foto/fotos/<%=objFile.Name %>">				Ver imagem</a> </div></td>			<%		End If		%>		<td align="center" bgcolor="#E6E6E6">			<div align="center">			  <input type="checkbox" name="delete"			value="<%= objFile.Name %>" />					</div></td>		<%	End IfNextSet objFolder = NothingSet objFSO = Nothing%><tr>	<td colspan="3" align="right">		<div align="center">		  <input name="btnDelete" type="submit" class="style9"		value="<%= DeleteButtonLabel %>">			</div></td></tr></table></form></body></html>

Toda unanimidade é Burra, compartilhe.

Compartilhar este post


Link para o post
Compartilhar em outros sites

Ea i cara?

 

viu eu tentei faze o que você falo, mais quando eu jogo pro ar, ele da esse erro:

 

Microsoft VBScript runtime error '800a004c'

 

Path not found

 

/f.asp, line 71

 

e as fotos estão dentro de caminho_fisico/fotos aqui estao as fotos.

 

e o codigo.

 

<%@ Language=VBScript %><% Option Explicit %><%Const ImageFilePath = "caminho_fisico/fotos"Const DeleteButtonLabel = "Excluir imagens marcadas"Dim objFSODim objFolderDim objFileDim strFileNameDim strFileExtensionDim blnShowImagesIf Request.QueryString("ShowImages") = "" Then	blnShowImages = FalseElse	blnShowImages = CBool(Request.QueryString("ShowImages"))End IfIf Request.Form("btnDelete") = DeleteButtonLabel Then	Set objFSO = Server.CreateObject("Scripting.FileSystemObject")	For Each strFileName In Request.Form("delete")		objFSO.DeleteFile(ImageFilePath & "/" & _			strFileName)	Next	Set objFSO = NothingEnd If%><html><head>  <title>ListList</title>  <style type="text/css"><!--.style9 {font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 10px;}a:link {	color: #666666;	text-decoration: none;}a:visited {	text-decoration: none;	color: #666666;}a:hover {	text-decoration: none;	color: #FF0000;}a:active {	text-decoration: none;	color: #666666;}-->  </style><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"></head><body><form action="<%= Request.ServerVariables("URL") %>?id=imagens&codigo=010203" method="post"><table width="100%" border="0" cellpadding=0 cellspacing=2 bordercolor=#0000FF bordercolorlight=silver bordercolordark=White><tr bgcolor=gainsboro>	<th><span class="style9">Nome da imagem</span></th>	<th><span class="style9">Imagem <a href="<%= Request.ServerVariables("URL") %>?ShowImages=<%= Not blnShowImages %>&id=imagens&codigo=010203">(Mostrar/Esconder)</a></span></th>	<th><span class="style9">Excluir</span></th></tr><%Set objFSO = Server.CreateObject("Scripting.FileSystemObject")Set objFolder = objFSO.GetFolder(ImageFilePath)For Each objFile In objFolder.Files	strFileExtension = LCase(Mid(objFile.Name, _		InStrRev(objFile.Name, ".", -1, 1) + 1))	If strFileExtension = "gif" Or strFileExtension = "jpg" Or _		strFileExtension = "jpeg" Then		%>		<tr>		<td bgcolor="#E6E6E6" class="style9">			<div align="center">			<%= objFile.Name %></div></td>		<%		If blnShowImages Then			%>			<td bgcolor="#E6E6E6" class="style9">				<div align="center"><img src="http://www.visualoutdoor.com.br/placas_foto/fotos/<%=objFile.Name %>" />			</div></td>			<%		Else			%>			<td bgcolor="#E6E6E6" class="style9">				<div align="center"><a href="http://www.visualoutdoor.com.br/placas_foto/fotos/<%=objFile.Name %>">				Ver imagem</a> </div></td>			<%		End If		%>		<td align="center" bgcolor="#E6E6E6">			<div align="center">			  <input type="checkbox" name="delete"			value="<%= objFile.Name %>" />					</div></td>		<%	End IfNextSet objFolder = NothingSet objFSO = Nothing%><tr>	<td colspan="3" align="right">		<div align="center">		  <input name="btnDelete" type="submit" class="style9"		value="<%= DeleteButtonLabel %>">			</div></td></tr></table></form></body></html>

Compartilhar este post


Link para o post
Compartilhar em outros sites

Como o próprio erro descreveu o caminho que você colocou esta apresentando erro.

 

o seguinte coloquei um exemplo no ar do script que te mandei so mudei o caminho físico.

 

o trecho que mudei

Const ImageFilePath = "D:/Inetpub/Clientes/comunicatoevolute.com.br/html/leandro/fotos/"

 

acesse para conferir http://www.comunicatoevolute.com.br/leandro/fotos/ver.asp

 

espero ter ajudado !!!

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.