Go Back   Velocity Reviews > Newsgroups > ASP Net
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply

ASP Net - BLOB in asp

 
Thread Tools Search this Thread
Old 01-19-2006, 09:25 AM   #1
Default BLOB in asp


How can I display BLOB(Oracle) data in asp page



Nau
  Reply With Quote
Old 01-19-2006, 02:09 PM   #2
Kevin Spencer
 
Posts: n/a
Default Re: BLOB in asp

Since a BLOB is simply binary data (a stream of 1s and 0s), you cannot
display int in an ASP.Net or ASP page unless you know what the data is.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
You can lead a fish to a bicycle,
but it takes a very long time,
and the bicycle has to *want* to change.

"Nau" <> wrote in message
news: ups.com...
> How can I display BLOB(Oracle) data in asp page
>



  Reply With Quote
Old 01-23-2006, 08:38 AM   #3
Nau
 
Posts: n/a
Default Re: BLOB in asp

I forgot to mention that i have a 'gif ' image stored in the
database(oracle 9i) in a BLOB column , i need to display this data in a
asp page

  Reply With Quote
Old 01-23-2006, 11:01 AM   #4
Kevin Spencer
 
Posts: n/a
Default Re: BLOB in asp

1. Create an ASP.Net page that will serve as an image. Use the
Request.QueryString to determine the file name. You can then add an image
tag to any page that points to its URL as it would point to an image file.
Example:

<img src="image.aspx?filename=foo.gif">

Read the data from the BLOB into a byte array. Set the Response.ContentType
of the page to "image/gif" Use Response.BiaryWrite to write the byte array
to the output stream.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Who is Mighty Abbott?
A twin turret scalawag.

"Nau" <> wrote in message
news: oups.com...
>I forgot to mention that i have a 'gif ' image stored in the
> database(oracle 9i) in a BLOB column , i need to display this data in a
> asp page
>



  Reply With Quote
Old 01-23-2006, 11:20 AM   #5
Daniel Fisher\(lennybacon\)
 
Posts: n/a
Default Re: BLOB in asp

Ya better write bit by bit

string _filePath = "..."

Response.Clear();
Response.ContentType = "image/gif";
Response.Buffer = false;
FileStream _fileStream = null;
byte[] _buffer = new byte[1024];
long _byteCount;
try
{
_fileStream = File.OpenRead(_filePath);
while ((_byteCount =
_fileStream.Read(_buffer, 0, _buffer.Length)) > 0)
{
if(Response.IsClientConnected)
{
Response.OutputStream.Write(
_buffer, 0, _buffer.Length);
Response.Flush();
}
else
{
return;
}
}
}
catch(Exception _ex)
{
throw _ex;
}
finally
{
_fileStream.Close();
}


--Daniel
http://staff.newtelligence.com/danielf/




-----Original Message-----
From: Kevin Spencer [private.php?do=newpm&u=]
Posted At: Monday, January 23, 2006 1:01 PM
Posted To: microsoft.public.dotnet.framework.aspnet
Conversation: BLOB in asp
Subject: Re: BLOB in asp

1. Create an ASP.Net page that will serve as an image. Use the
Request.QueryString to determine the file name. You can then add an
image
tag to any page that points to its URL as it would point to an image
file.
Example:

<img src="image.aspx?filename=foo.gif">

Read the data from the BLOB into a byte array. Set the
Response.ContentType
of the page to "image/gif" Use Response.BiaryWrite to write the byte
array
to the output stream.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Who is Mighty Abbott?
A twin turret scalawag.

"Nau" <> wrote in message
news: oups.com...
>I forgot to mention that i have a 'gif ' image stored in the
> database(oracle 9i) in a BLOB column , i need to display this data in

a
> asp page
>



  Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump