By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,377 Members | 1,660 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,377 IT Pros & Developers. It's quick & easy.

Code to download an image without having to right click a link?

w33nie
P: 56
I was wondering what I would need to do to make a link, when clicked, download an image with the save as window, instead of just loading the image inside the browser.
I also don't want to have to right click the link & click save as
Apr 3 '08 #1
Share this Question
Share on Google+
4 Replies


drhowarddrfine
Expert 5K+
P: 7,435
You can't with html/css without setting options in the browser.
Apr 4 '08 #2

w33nie
P: 56
Is there any way to at all?
Apr 4 '08 #3

eWish
Expert 100+
P: 971
I would think that you could zip your image file and then you should be able to download the file.

--Kevin
Apr 4 '08 #4

drhowarddrfine
Expert 5K+
P: 7,435
By default, browsers are set to open files with image name extensions in a browser window. If you wanted, say a .jpeg file, to be downloaded instead, you would need to tell the browser to not display .jpeg files, but then it would never display jpegs.

Whether or not this can be done with javascript, you would need to ask on that board.
Apr 4 '08 #5

Post your reply

Sign in to post your reply or Sign up for a free account.