Link to home
Start Free TrialLog in
Avatar of elenjickal
elenjickal

asked on

Save Image Link/Button

Hi,
I need to put a save link/button for an image in the HTML page.  To be short, I don't want the user to right-click and choose the option "Save Picture As" or "Save Image" of the browser.  Instead I want the user to click a link or button that is displayed just under the image.  After clicking the link/button, the user should be able to save the image in his/her local hard disk/machine in a particular folder or just under C:\ or bringing up the file directory dialog box where the user can save in his/her own folder.  I am using jsp to code the page.

Is it possible to do this with jsp, html, or javascript?  Can anyone help me?

I don't want to zip the image and then give a link in the html, because the image is dynamically created using EazayCharts depending on the values from the server.  Else it will be good if I can know how to zip an image/file dynamically and then store/save in user's disk/machine.

Thanks

John Williams
Avatar of dorward
dorward

Avatar of elenjickal

ASKER

Hi Dorward,

Thanks for the link.  But I am sorry, that I wasn't able to get anything valuable for my question.

Thanks and Regards

John Williams
ASKER CERTIFIED SOLUTION
Avatar of OsirisX
OsirisX

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
   you can disble the rigth click of the mouse button, so the any one can't get save as .. by clickin the right mouse  button

      function Disable_Select(){
       window.event.returnValue=false
      }

    call this function with in the boday tag, like
   <body oncontextmenu="Disable_Select();" onselectstart="Disable_Select();">
   ......
   ......
   ......
   </body>
  All the best
Hi Damitha

Thank you for the reply.

I don't prefer to disable the right mouse button.  The reason is that I am developing a product that monitors the e-infrastructure.  (Check www.eginnovations.com to know more about the product)

However, it will be good if I give a button or link to save the image in the web page and then disable the right-click button.

Anyway thanks a lot for replying and giving me the code for disable right-click.

With Warm Regards

John Williams
You could have a signed activex control. that would work. Make an activex control using VB that downloads the file and prompts the user and saves it.
If you can run server side scripts, then i can show you how to prompt the user to save this picture
Hi OsirisX

Thanks a lot for the reply.

Yes, I can run server side scripts.  I use JSP and JavaScript with SQL (and Oracle for clients who don't use/have SQL).  I am very sorry that I don't want to use VBScript since it won't work in Netscape browsers.  

It will be really good and very helpful if you can show me how to run server side scripts for my requirements.

Thanks and Regards

John Williams
OK there are two ways to do it server side. Are you writing the application that generates the dynamic images or do you have direct access to its code? If you do, you can make a function that just changes the content type header to something unrecognized by the browser like "x/y" or you can change the content-dispositon to indicate to IE that it is an attatchment. But...you said you wanted it to work in netscape...so I don't think that would work. But the Content Type setting would.

If you do not have direct access to the code, you can build somewhat of a proxy script, that, gets the image output from the dynamic script, and sends it to the user with the new content type header.
I feel I answered the question, I think I deserve the points.
This question has been abandoned. I will make a recommendation to the
moderators on its resolution in a week or two. I appreciate any comments
that would help me to make a recommendation.
<note>
   In the absence of responses, I may recommend DELETE unless it is clear
   to me that it has value as a PAQ.  Silence = you don't care
</note>

Cd&
It is time to clean this abandoned question up.

I am putting it on a clean up list for CS.

<recommendation>
points to OsirisX

</recommendation>

If anyone participating in the Q disagrees with the recommendation,
please leave a comment for the mods.

Cd&