there are two pages involved, webform1.aspx and HiRes.aspx. In
Webform1.aspx I write a .jpg to the root of d: and do :
Server.Transfer("HiRes.aspx")
HiRes.aspx is as follows:
<%@ Page Language="vb" ContentType="image/jpeg" AutoEventWireup="false"
Codebehind="HiRes.aspx.vb" Inherits="DBAPhotoQuery.HiRes"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>test</title>
<meta name="GENERATOR" content="Microsoft Visual Studio .NET 7.1">
<meta name="CODE_LANGUAGE" content="Visual Basic .NET 7.1">
<meta name=vs_defaultClientScript content="JavaScript">
<meta name=vs_targetSchema
content="http://schemas.microsoft.com/intellisense/ie5">
</head>
<body MS_POSITIONING="GridLayout">
<form id="Form1" target="_blank" method="post" runat="server">
</form>
</body>
</html>
and the CodeBehind for hires.aspx is as follows:
Imports System.Drawing.Imaging
Public Class HiRes
Inherits System.Web.UI.Page
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Response.Clear()
Dim oBmp As Bitmap
oBmp = New Bitmap("d:\bigpic.jpg")
oBmp.Save(Response.OutputStream, imageformat.jpeg)
Response.End()
End Sub
End Class
What happens is that the picture does indeed get written but to
webform1.aspx. What was in webform1.aspx is completely replaced by just the
image. You might notice that I put Target="_blank" in an attempt to get it
to display a new i.e. page.
Thanks,
T
"Jerry III" <> wrote in message
news:...
> What does it come as? You're clearly telling the client that it's an
> image/jpeg and you're saving it as such and I'm doing this all the time
and
> it works just fine. Could you be more specific? Maybe you're saving more
> than the image to the response or you're not setting the headers right...
>
> Jerry
>
> "Tina" <> wrote in message
> news:...
> > Natty,
> > That doesn't come through to the client browser as a .jpg and is there
> fore
> > either impossible or very difficult for them to save the file as a .jpg.
> I
> > do this all the time from static pages but can't seem to make it work
from
> > aspx pages and vb.net code.
> > Thanks,
> > T
> > "Natty Gur" <> wrote in message
> > news:...
> > > Hi,
> > >
> > > change the ContentType and write the jpeg.
> > > Response.ContentType = "image/jepg"
> > > ..
> > > oBmp = New Bitmap(strPath)
> > > ..
> > > oBmp.Save(Response.OutputStream,
> > > System.Drawing.Imaging.ImageFormat.Jpeg)
> > >
> > > Natty Gur, CTO
> > > Dao2Com Ltd.
> > > 34th Elkalay st. Raanana
> > > Israel , 43000
> > > Phone Numbers:
> > > Office: +972-(0)9-7740261
> > > Fax: +972-(0)9-7740261
> > > Mobile: +972-(0)58-888377
> > >
> > >
> > > *** Sent via Developersdex http://www.developersdex.com ***
> > > Don't just participate in USENET...get rewarded for it!
> >
> >
>
>