473,804 Members | 3,225 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 2347
pronerd
392 Recognized Expert Contributor
You would want to change the HTTPResponse mime type to be a nonsense value like "applicatio n/download" or "applicatio n/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 "applicatio n/download" or "applicatio n/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
21956
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 play it without having to right-click and save. How can I force the browser to pop up the "save file as" dialog box instead of playing it? I know that I can encapsulate it in a zip file which will download and open WinZip. Thanks
15
4582
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 you.. Frances
4
3341
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 right click the link & click save as
24
9798
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 be able to do this for my browser, but I want it scripted into my web site, because I can't tell all of my users to edit their browser's settings I don't want to have to right click the link & click save as, and I don't want to have to zip the...
0
9708
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9588
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
10327
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10085
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9161
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6857
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5663
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3828
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2999
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.