Ir para conteúdo

POWERED BY:

Arquivado

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

aluizs

Download de imagens em grupo

Recommended Posts

Ola,

 

não sei se este é o local correto para pastar esta questão, porém vamos lá, como faço para exibir em uma página da internet várias miniaturas de fotos com um campo check, e depois que o usuário selecionar as fotos desejadas, criar um arquivo único (zipado) e assim fazer o download do pacote.

 

 

Obrigado,

 

André

Compartilhar este post


Link para o post
Compartilhar em outros sites

olá aluizs, tudo bem?

 

Então, para fazer isso é necessário uma linguagem server-side (PHP, ASP...)

 

Tem alguma preferência de linguagem para que eu possa mover o tópico para o fórum correto? :)

 

 

Caso não tenha, particularmente recomendo PHP. ;)

 

Mas aguardo uma posição sua.

 

 

 

Abraços. http://forum.imasters.com.br/public/style_emoticons/default/joia.gif

Compartilhar este post


Link para o post
Compartilhar em outros sites

Tiago,

 

muito obrigado pela atenção.

 

A linguagem que eu preciso é asp, pois o site do cliente é todo em asp/ajax.

 

 

Obrigado, mais uma vez

 

André

Compartilhar este post


Link para o post
Compartilhar em outros sites

você pode usar uma galeria para exibir as imagens, após o user selecionar as mesmas, você pode usar um componente para zipar as imagens e disponibilizar o download, existem alguns exemplos no lab. de script pode te ajudar

Compartilhar este post


Link para o post
Compartilhar em outros sites

Existem algumas funções que fazem este trabalho.

 

Um script que indico é este que foi postado nesse fórum

 

http://forums.aspfree.com/code-bank-54/creating-zip-files-using-classic-asp-66544.html

 

<%
'---------------------------------------------------------
'CreateZipFile: creating zip file in the given path.
'strZipPath - full path for the zip file, including the zip file name.
'arrFilesPath - array of the files to be zipped, e.g. Array("C:\*.exe", "C:\test\*.*")
'NOTE: this code requires PKZIP25.EXE utility in the same location
'	as this file.
'---------------------------------------------------------
Sub CreateZipFile(strZipPath, arrFilesPath)
	Const PKZIP_FILE_NAME="pkzip25.exe"
	Dim strCommand, objShell, objFSO
	Dim x
	
	'first verify pkzip exists:
	Set objFSO=Server.CreateObject("Scripting.FileSystemObject")
	If Not(objFSO.FileExists( Server.MapPath(PKZIP_FILE_NAME) )) Then
		Set objFSO=Nothing
		Err.Raise 20000, "Zip File Creator", "zip utility not found: "&Server.MapPath(PKZIP_FILE_NAME)
	End If
	'delete current file, if exists:
	If objFSO.FileExists(strZipPath) Then
		objFSO.DeleteFile(strZipPath)
	End If
	Set objFSO=Nothing
	
	'build batch command:
	strCommand=Server.MapPath(PKZIP_FILE_NAME)&" -add "&strZipPath&" "
	For x=0 To UBound(arrFilesPath)
		strCommand=strCommand&arrFilesPath(x)
		If x<UBound(arrFilesPath) Then strCommand=strCommand&" "
	Next
	
	'execute:
	Set objShell=Server.CreateObject("WScript.Shell")
	objShell.Run strCommand, 0, True 'wait!
	
	'done.
	Set objShell=Nothing
End Sub
%>

Chamando a função e zipando o arquivo.

 

<% Option Explicit %>
<!-- #include file="ZipFiles.asp" -->
<%
Call TestZipFile()

Sub TestZipFile()
	'create zip and give link:
	Call CreateZipFile(Server.MapPath("myzip.zip"), Array(Server.MapPath("images")&"\*.*"))
	Response.Write("<a href=""myzip.zip"">download zip</a>")
End Sub
%>

Ta ai, existe outros scripts já prontos que fazem este trabalho, basta utilizar a cabeça e colocar o script para rodar a sua necessidade.

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.