If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ASP > download images

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 10-12-05, 05:03
faamugol faamugol is offline
Registered User
 
Join Date: Mar 2004
Posts: 58
download images

Hello guys,

Here is the code I use in order to list the images but I still do not know how to dispalys the pop up in order to be able to dave or to open

<%
Dim str_tbl, counter,imgnumber
imgnumber = 36
counter = 1
str_tbl = "<table border ='1'>" & _
"<tr><td colspan='2'>Cliquez sur la photo ou sur le lien pour T&eacute;l&eacute;charger</td></tr>"
For counter = 1 to imgnumber-1 step 2
str_tbl = str_tbl & "<tr>" & _
"<td><a href=gallerie/" & counter & ".jpg>" & "<img border='1' width ='200' height = '200' src=gallerie/" & counter & ".jpg>" & "<br>T&eacute;l&eacute;charger</a></td>" & _
"<td><a href=gallerie/" & counter +1 & ".jpg>" & "<img border='1' width ='200' height = '200'src=gallerie/" & counter +1 & ".jpg>" & "<br>T&eacute;l&eacute;charger</a></td>"
str_tbl = str_tbl & "</tr>"

next
str_tbl = str_tbl & "</table>"

Response.Write str_tbl & "<br>"
%>



Can any body helps me please
Reply With Quote
  #2 (permalink)  
Old 10-25-05, 20:36
Bullschmidt Bullschmidt is offline
Guru
 
Join Date: Jun 2003
Location: USA
Posts: 1,032
Perhaps you could remind users that to save an image that can do right click | Save Picture As...
__________________
J. Paul Schmidt, Freelance Web and Database Developer
www.Bullschmidt.com
Access Database Sample, Web Database Sample, ASP Design Tips
Reply With Quote
  #3 (permalink)  
Old 10-26-05, 02:48
rokslide rokslide is offline
Registered User
 
Join Date: Nov 2003
Location: Christchurch, New Zealand
Posts: 1,617
You could try streaming the image down but it will probably just automatically open in whatever they have it associated with....

I agree with Bull, tell them to right click and save picture as....
Reply With Quote
  #4 (permalink)  
Old 10-26-05, 12:21
chuck59 chuck59 is offline
Registered User
 
Join Date: Oct 2005
Location: Karachi
Posts: 6
Actually, you can do this by using ADODB.Stream object, but all 36 images could not be made available for download at once. You can link each image to another asp page, which shall use the adodb.stream object to read image data from file system and pop-up the dialog for visitor to save the image.

Here is a short example of reading a zip file from drive and make it available to the visitor to downlaod it. you'll need to modify it to meet your needs ...

Code:
set oFile = server.CreateObject("ADODB.Stream")
oFile.Open
oFile.LoadFromFile ("C:\files\download.zip")
oFile.Type = 1
sFileData = oFile.Read(-1)
lsize = oFile.Size
oFile.Close
set oFile = nothing
Response.AddHeader "Content-Disposition", "attachment; filename=" & chr(34) & "download.zip" & chr(34)
Response.AddHeader "Content-Length", lsize
Response.ContentType = "application/x-zip-compressed"
Response.Flush
Response.BinaryWrite sFileData
on error goto 0
Response.End
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On