Need To Output and Image From a URL

R

rh1200la

Hey all. I need to output an image via an .aspx page and hope someone
here can help.

I would like to display an image like this:

<img src="displayImage.aspx?categoryID=1">

The .aspx page will grab a random URL from the database based on the
category id.
I would like the script to load the URL and download the image, and
then have the output be of content type image/gif.

Is there a simple way to do this? I'm not sure if I can use the
XMLHTTP object due to firewall settings on our server, but I'm not 100%
sure on this.

thanks.

-RH
 
R

rh1200la

Close except my database table will hold the external url of an image
that lives on other servers, so the data type will be a varchar, not
binary.

In your first link there's this:
-System.Drawing.Image.FromFile(Server.MapPath(imageUrl))

which loads the image from the server. i don't think this would work
for me.

thanks.
 
J

John Timney \(MVP\)

Excuse my confusion, but I'm not sure what your problem actually is then, if
the image is simply a URL held in the database why cant you just bind it to
the image src?

--
Regards

John Timney (MVP)
VISIT MY WEBSITE:
http://www.johntimney.com
 
R

rh1200la

Understandable for the confusion.

What I'm doing is displaying a random ad (url and image) in an HTML
E-mail template. Unfortunately I cannot run a server script to query
the database and output the HTML block that easily. I believe
outputting an actual image would do the trick in this case.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,074
Latest member
StanleyFra

Latest Threads

Top