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 7 of 7
  1. #1
    New to the CF scene
    Join Date
    Jul 2004
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Exclamation Is it possible to have a script/link to copy an image?

    I know of the script/link to copy the image url, but is it possible to copy the whole image? or save picture as? it would be so great if someone replied XD. ive been stuck on it forever.

  • #2
    Kor
    Kor is offline
    Red Devil Mod Kor's Avatar
    Join Date
    Apr 2003
    Location
    Bucharest, ROMANIA
    Posts
    8,478
    Thanks
    58
    Thanked 379 Times in 375 Posts
    Yes, using execCommand('SaveAs') method and a trick (a hidden iframe in which pictures are loaded - because execCommand('SaveAs') method works for entire HTML page only).

    See exemple in attachment

    NOTE: this is an only IE method !! There is no cross-browser methods for othjer browsers
    Attached Files Attached Files
    KOR
    Offshore programming
    -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*

  • #3
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,037
    Thanks
    0
    Thanked 250 Times in 246 Posts
    You can simplify the code like this:
    Code:
    function saveAs(a){
      top.frames[0].location.replace(a);
      top.frames[0].focus();
      setTimeout("top.frames[0].document.execCommand('SaveAs')",1);
    }

  • #4
    Kor
    Kor is offline
    Red Devil Mod Kor's Avatar
    Join Date
    Apr 2003
    Location
    Bucharest, ROMANIA
    Posts
    8,478
    Thanks
    58
    Thanked 379 Times in 375 Posts

    Thumbs up

    Yes Glenn, good ideea, tx!
    KOR
    Offshore programming
    -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*

  • #5
    New to the CF scene
    Join Date
    Jul 2004
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts
    tnx so0o much

  • #6
    New to the CF scene
    Join Date
    Jul 2004
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Wait, can I ask a question??? Last one I promise XP. I just wanted to know how to make it so it only target one specific iframe? coz the image keeps appearing in my tag board lol XD. tnx.

    well, if i use the one kor gave me, it kinda stuffs up. but if i use the one glenn gave me, it kinda goes in the taggy frame. is there a way i can fix this?
    Last edited by lilmizzvi0let; 07-10-2004 at 06:11 AM.

  • #7
    New to the CF scene
    Join Date
    Jul 2004
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by lilmizzvi0let
    Wait, can I ask a question??? Last one I promise XP. I just wanted to know how to make it so it only target one specific iframe? coz the image keeps appearing in my tag board lol XD. tnx.

    well, if i use the one kor gave me, it kinda stuffs up. but if i use the one glenn gave me, it kinda goes in the taggy frame. is there a way i can fix this?
    no worries, i think i fixed it...


  •  

    Posting Permissions

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