Problems with image types and response streams....

G

Guest

I am having a real problme returning an image from a directory that isn't
under my webserver..

I.E.
the image is on my F: drive but my website exists in the D: and I have no
intention of adding the F: drive or any of it's subdirectorys to my website.

The problem relates to the image / response.type..

I am reading a jpg and my web app is returning a bmp :(

The code is reativly simple (but I have tried making it harder :) - using
graphics objects and encoderparams... Result = the same.. bitmap.. 600 k
image = 1.5 megs... :(


CODE
Dim i As System.Drawing.Image = Image.FromFile(s)
Response.Clear()
Response.ContentType = "image/pjpeg"
i.Save(Response.OutputStream, Imaging.ImageFormat.Jpeg)
i.Dispose()
Response.End()

Any help appreciated..

Rob
 

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,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top