Re: Can images be saved to Session State and retrieved?
- From: "Vijay" <VijayR@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Thu, 4 Aug 2005 03:33:02 -0700
Hi,
I think this should work just for converting the bitmap to a byte stream:
--------------------------------------------------------------------
FileStream Fs = new
FileStream(TextBox2.Text.Trim(),FileMode.Open,FileAccess.Read);
byte[] RawData = new byte[Fs.Length];
Fs.Read(RawData,0,Convert.ToInt32(Fs.Length));
Fs.Close();
Session.Add("FileData",RawData);
-------------------------------------------------------------------
Now assuming that the file format is always bmp, we have to work on
converting it back into bmp.
will work on this :-)
++Vijay R
"charliewest" wrote:
> Thanks Vijay,
>
> As simple as this might sound, it's taking me forever. Could you pls point
> me to some sample code?
>
> The sample code i find, requires that i know the size and file type of the
> image (bitmap) in the database, which i might not... I don't seem to find a
> sample which is as "simple" as your solution seems to imply.
>
> thanks
>
> "Vijay" wrote:
>
> > Hi,
> >
> > Why not covert the Image to Binary and then store it in session with the Img
> > format?
> > Is this a bad idea?
> >
> > ++Vijay R
> >
> >
> > "Brock Allen" wrote:
> >
> > > Why not? Check out the Bitmap class.
> > >
> > > -Brock
> > > DevelopMentor
> > > http://staff.develop.com/ballen
> > >
> > >
> > >
> > > > Hello -
> > > >
> > > > I have images saved in my SQL SERVER 2000 database. Using ASP.NET (C#)
> > > > is there any way to temporarily save an image to a session object, and
> > > > after running some other operations, later retrieve the image from the
> > > > session object, convert it back to an image, and re-save it to the
> > > > database?
> > > >
> > > > Thanks?
> > > >
> > >
> > >
> > >
> > >
.
- Follow-Ups:
- References:
- Can images be saved to Session State and retrieved?
- From: charliewest
- Re: Can images be saved to Session State and retrieved?
- From: Brock Allen
- Re: Can images be saved to Session State and retrieved?
- From: Vijay
- Re: Can images be saved to Session State and retrieved?
- From: charliewest
- Can images be saved to Session State and retrieved?
- Prev by Date: Re: String Collection Property Editor
- Next by Date: vb.net windowsform application to asp.net
- Previous by thread: Re: Can images be saved to Session State and retrieved?
- Next by thread: Re: Can images be saved to Session State and retrieved?
- Index(es):
Relevant Pages
|