473,503 Members | 2,173 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

w33nie
56 New Member
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 don't want to have to right click the link & click save as,
and I don't want to have to zip the file.

I originally posted this in the HTML section, and was told to post here - http://bytes.com/forum/thread790863.html
Apr 4 '08 #1
3 2332
pronerd
392 Recognized Expert Contributor
You would want to change the HTTPResponse mime type to be a nonsense value like "application/download" or "application/unknown". This is not something you would do with JavaScript. It would have to be done with a server side language, or with the configuration of your web server.
Apr 4 '08 #2
w33nie
56 New Member
You would want to change the HTTPResponse mime type to be a nonsense value like "application/download" or "application/unknown". This is not something you would do with JavaScript. It would have to be done with a server side language, or with the configuration of your web server.
I'll post this in the PHP section then?

thanks
Apr 4 '08 #3
rnd me
427 Recognized Expert Contributor
in firefox, you could save the images as uncompressed png images. these could be opened using a weird mime type like mentioned above, but with the data being hosted by the client using a data URL. using the canvas tag provides an interface to the image data in firefox and opera.

would this code be of use you you?
Apr 6 '08 #4

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

Similar topics

4
21923
by: Kevin Muenzler, WB5RUE | last post by:
How do I force a browser to download a file instead of displaying it? In other words I have a page with MP3 and WMA files on it and I would like for the visitor to download the file instead of...
15
4551
by: Frances Del Rio | last post by:
I have a bunch of Photoshop images on my server, I want when user clicks on a link to a Photoshop img for it to start downloading (like when you click on a Word file..) how can I do that? thank...
4
3322
w33nie
by: w33nie | last post by:
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...
24
9757
w33nie
by: w33nie | last post by:
I was wondering what I would need to do to make a link, when clicked, download an image with the Save As dialog box, instead of just loading the image inside the browser. I know that MIME edit would...
0
7205
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7093
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7349
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7008
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7467
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5594
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5022
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3177
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1521
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.