Results 1 to 4 of 4

Thread: download images

  1. #1
    Join Date
    Mar 2004
    Posts
    58

    Unanswered: 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

  2. #2
    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

  3. #3
    Join Date
    Nov 2003
    Location
    Christchurch, New Zealand
    Posts
    1,618
    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....

  4. #4
    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •