...

View Full Version : Download image through a text link



mattym
01-13-2004, 11:46 AM
Hi all,

I am attempting to create an image Library.

I have seen examples before where there is a thumbnail and next to it links to jpegs of different sizes/resolution and when these links are clicked a save dialogue box appears. I hope this makes sense.

I know I can create zips for each jpeg and this will create a save dialogue box when linked to, but this is not an option for me. I need it to link directly to the jpeg like on these other sites.

Does anyone know how I can do this?

many thanks

matt

Kor
01-13-2004, 01:46 PM
IE accept something like (if I remember well)

document.execCommand('SaveAs') method... Never test it, You may find some references on the Net about it...

Kor
01-13-2004, 01:56 PM
http://www.codefoot.com/javascript/script_invoke_saveas.html

mattym
01-13-2004, 02:22 PM
Hi thanks for this!

not sure if it's just me but it looks like you can only save the html page you are working on and not elements of it!? Is that right?

Kor
01-13-2004, 03:40 PM
obviousely... as you use document.method()...

So...try to build an object and fire this method upon him.

glenngv
01-14-2004, 03:40 AM
You need to do it using a server-side language. Javascript can't do it. If you don't have access to any server-side language, you can just instruct the user to right-click the link and select 'Save Picture As...' option.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum