BLOB in asp

Discussion in 'ASP .Net' started by Nau, Jan 19, 2006.

  1. Nau

    Nau Guest

    How can I display BLOB(Oracle) data in asp page
    Nau, Jan 19, 2006
    #1
    1. Advertising

  2. 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:...
    > How can I display BLOB(Oracle) data in asp page
    >
    Kevin Spencer, Jan 19, 2006
    #2
    1. Advertising

  3. Nau

    Nau Guest

    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
    Nau, Jan 23, 2006
    #3
  4. 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:...
    >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
    >
    Kevin Spencer, Jan 23, 2006
    #4
  5. 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 [mailto:]
    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:...
    >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
    >
    Daniel Fisher\(lennybacon\), Jan 23, 2006
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jonathan
    Replies:
    4
    Views:
    1,098
    bruce barker
    Dec 15, 2004
  2. coynej60

    printing blob data asp.net

    coynej60, Oct 12, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    590
    coynej60
    Oct 12, 2005
  3. ASP.NET mySQL BLOB

    , Aug 27, 2006, in forum: ASP .Net
    Replies:
    4
    Views:
    1,015
    Cuyler
    Aug 28, 2006
  4. Raf

    Showing BLOB-fields in ASP.NET

    Raf, Oct 29, 2008, in forum: ASP .Net
    Replies:
    1
    Views:
    420
    Alex Meleta
    Oct 30, 2008
  5. behdad
    Replies:
    6
    Views:
    3,152
    Alexey Smirnov
    Jan 20, 2009
Loading...

Share This Page