![]() |
|
|
|
#1 |
|
How can I display BLOB(Oracle) data in asp page
Nau |
|
|
|
|
#2 |
|
Posts: n/a
|
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 > |
|
|
|
#3 |
|
Posts: n/a
|
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 |
|
|
|
#4 |
|
Posts: n/a
|
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 > |
|
|
|
#5 |
|
Posts: n/a
|
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 > |
|