Page that sends jpg stream

M

M K

Our production software (which works with images) has an
internal webserver operating on port 80. This resides in
within our firewall. It processes scripts (kpl scripts)
that generate an image. So on our intranet if we have an
image tag with a src
of '//internalServer/render/script.kpl?Value1=2341' the
image appears on the page. That is because the browser on
the intranet makes a call to the internalServer and the
script in question, and reads the jpg file streamed back.
However, we have customers that we want to be able to see
these generated images. They cannot use, nor do we want
them to, the src I mentioned above.
Can I write an aspx page that I can pass as the src for
the image instead, but will pull the image from the script?

The production software company says it is permitted, but
do not have information on how to do it. The webserver is
in a DMZ, but can access the internalServer.
 
V

vMike

You can make the src=somepage.aspx. The aspx file can accept querystrings.
Your page would contain
something like the following

mynewimage = code to get the image from disk and maybe modify it then
Response.ContentType = "image/jpeg"
mynewimage.Save(Response.OutputStream, ImageFormat.Jpeg)

where mynewimage is a system.drawing.image

For example this get the image from disk and adjusts the size

Function mgAdjustBitmap(strFile as string, intHorz as integer, intVert as
integer) as bitmap

Dim mysize as size = new size(inthorz,intVert)
Dim myBitmap As bitmap = New Bitmap(strFile)
myBitmap = new bitmap(mybitmap,mysize)
return myBitmap
End Function
 

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

Forum statistics

Threads
473,743
Messages
2,569,478
Members
44,898
Latest member
BlairH7607

Latest Threads

Top