Well break it down into steps, first you need to get the image clickable AND have the click be caught by your server code.
I would suggest making a new aspx page called like ImageDownloader.aspx
And make that page have its sole job is to perform those sneaky manuvers.
So for an image like this:
[html]
<img id="myimage" src="http://www.google.com/intl/en_ALL/images/logo.gif">[/html]
You could have an onclick method that goes to:
-
http://mywebsite/ImageDownloader.aspx?url=http://www.google.com/intl/en_ALL/images/logo.gif
-
Then inside your ImageDownloader.aspx file, parse out the URL
-
if (Request.Params["url"]!=null)
-
{
-
// validate the string, attempt to fetch the data, then send it back with the code i posted earlier
-
}
-
else
-
{
-
// respond back with an error of somesort
-
}
-