...

View Full Version : Is it possible to have a script/link to copy an image?



lilmizzvi0let
07-09-2004, 11:49 AM
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.

Kor
07-09-2004, 12:41 PM
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

glenngv
07-09-2004, 01:21 PM
You can simplify the code like this:


function saveAs(a){
top.frames[0].location.replace(a);
top.frames[0].focus();
setTimeout("top.frames[0].document.execCommand('SaveAs')",1);
}

Kor
07-09-2004, 02:26 PM
Yes Glenn, good ideea, tx! :thumbsup:

lilmizzvi0let
07-09-2004, 09:35 PM
tnx so0o much

lilmizzvi0let
07-10-2004, 07:07 AM
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?

lilmizzvi0let
07-10-2004, 07:32 AM
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...



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum