Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6

Thread: Download Image?

  1. #1
    New Coder
    Join Date
    Apr 2004
    Posts
    76
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Download Image?

    I have this javascript photo album i made. It is all working in tables and such. When you roll over a certain cell it will show that picture above, and turn the cell a different color. I also made the cell "clickable" when they are on it.

    Is there anyway i can get it to when someone clicks that cell, that it will download that picture?? I have looked everywhere but i have not see anythign that will allow me to do that. Any ideas?

    Here is the snippit of the code when you roll over that cell:

    <tr bordercolor="white">
    <td class="menu" bordercolor="000000" style="cursor:hand" onMouseOver="doButtons('candyhat'),movein(this)" onMouseOut="doButtons('a'),moveout(this)" onClick="MM_goToURL('parent','#');return document.MM_returnValue""><div align="center">
    <p>Gold Hat</p>
    Last edited by Athmaus; 04-18-2005 at 06:09 PM.

  • #2
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,037
    Thanks
    0
    Thanked 250 Times in 246 Posts
    It cannot be done with Javascript. Are you using a server-side language? I know of an ASP script that can force download any file.

  • #3
    New Coder
    Join Date
    Apr 2004
    Posts
    76
    Thanks
    0
    Thanked 0 Times in 0 Posts
    yes i can use ASP on this page.

  • #4
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,037
    Thanks
    0
    Thanked 250 Times in 246 Posts
    You might get an idea from this thread. You will use the same script that I gave to the thread starter. You will just specify different value for the parameter in the SendStreamToBrowser subroutine.

    SendStreamToBrowser LoadStream(localPathOfFile), filename, "", false

    If that doesn't work, use:

    SendStreamToBrowser LoadStream(localPathOfFile), filename, false, false

  • #5
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    What about php can u use php also? You can use the headers to pass off a file as an attachment, and then just link to the php page that has the correct headers in it.

  • #6
    New Coder
    Join Date
    Apr 2004
    Posts
    76
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by _Aerospace_Eng_
    What about php can u use php also? You can use the headers to pass off a file as an attachment, and then just link to the php page that has the correct headers in it.
    I am already using ASP for the login and session's already so i dont think i can use php (plus i have zero expierence with php)

    glenngv,

    I will try that script out and let you konw later on thanks


  •  

    Posting Permissions

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