473,386 Members | 2,114 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Need To Output and Image From a URL

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

Sep 20 '06 #1
4 1560
This is one for google, as theres a ton of example already out there to help
you.

Two to get you started........

http://aspnet.4guysfromrolla.com/articles/012203-1.aspx
http://www.codeproject.com/aspnet/ImageBinaryStream.asp

Between those two you should find everything you require to create your own
solution.
--
Regards

John Timney (MVP)
VISIT MY WEBSITE:
http://www.johntimney.com
<rh******@gmail.comwrote in message
news:11*********************@b28g2000cwb.googlegro ups.com...
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

Sep 20 '06 #2
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(image Url))

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

thanks.


John Timney (MVP) wrote:
This is one for google, as theres a ton of example already out there to help
you.

Two to get you started........

http://aspnet.4guysfromrolla.com/articles/012203-1.aspx
http://www.codeproject.com/aspnet/ImageBinaryStream.asp

Between those two you should find everything you require to create your own
solution.
--
Regards

John Timney (MVP)
VISIT MY WEBSITE:
http://www.johntimney.com
Sep 20 '06 #3
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
<rh******@gmail.comwrote in message
news:11**********************@b28g2000cwb.googlegr oups.com...
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(image Url))

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

thanks.


John Timney (MVP) wrote:
>This is one for google, as theres a ton of example already out there to
help
you.

Two to get you started........

http://aspnet.4guysfromrolla.com/articles/012203-1.aspx
http://www.codeproject.com/aspnet/ImageBinaryStream.asp

Between those two you should find everything you require to create your
own
solution.
--
Regards

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

Sep 20 '06 #4
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.

John Timney (MVP) wrote:
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
<rh******@gmail.comwrote in message
news:11**********************@b28g2000cwb.googlegr oups.com...
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(image Url))

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

thanks.


John Timney (MVP) wrote:
This is one for google, as theres a ton of example already out there to
help
you.

Two to get you started........

http://aspnet.4guysfromrolla.com/articles/012203-1.aspx
http://www.codeproject.com/aspnet/ImageBinaryStream.asp

Between those two you should find everything you require to create your
own
solution.
--
Regards

John Timney (MVP)
VISIT MY WEBSITE:
http://www.johntimney.com
Sep 20 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: lawrence | last post by:
Can someone please tell me where I can get some open source code for resizing images? I know such code has been written a million times and I don't feel like doing it again from scratch.
6
by: Tim Streater | last post by:
I want to generate a web page using PHP, and in the middle generate a graphic I read from another server. So the graphic is in $picture. So I can either write $picture to a temp file and then use...
2
by: Richard | last post by:
In an attempt to try out some things with php, I have run into a new snag. The output file is pure text. Basically it's a simple photo gallery using <ul> links to show various thumbnails. In...
6
by: QuasiChameleon | last post by:
Hi, I'm trying to create a grayscale image class that reads and writes grayscale Targa format. This works well with smaller images, but corrupts larger images and creates a "Segmentation fault...
4
by: Phil | last post by:
k, here is my issue.. I have BLOB data in SQL that needs to be grabbed and made into a TIF file and placed on the client (could be in temp internet dir). The reason we need it in TIF format is...
3
by: Ivan Demkovitch | last post by:
Hi! I'm using output stream to output image to webpage. //Move array to response stream. Response.ContentType = "image/jpeg"; Response.OutputStream.Write(arrBt, 0, arrBt.Length);...
2
by: jain_tj | last post by:
Could anyone please help me with the following problem My xml file is ============== <fig id="F0000001"> <caption>Caption text</caption> <image id="I0000001" image.class="halftone"...
0
by: ameshkin | last post by:
Hi, Im pretty new at PHP and need help with something very simple. I wrote a function which watermarks an image. The function works, but i can't figure out how to output the image into a file. ...
3
by: John Williams | last post by:
I'm writing a stagenography program to experiment with how it works. The algorithm I'm using appears to be producing the correct result...however I'm struggling with the file input. I never...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.