Can't display images stored as Oracle BLOBs

Ask a Question related to ASP Database, Design and Development.

  1. #1

    Default Can't display images stored as Oracle BLOBs

    I have been fighting with storing/retrieving images in an Oracle
    database using ASP for over a month now. I have been able to store
    images < 64K w/ no problems. However, images > 64K have been a problem
    since day one. We've updated our ODBC drivers and it appears that
    images > 64K are being stored ... well, more correct than before.
    Prior to the new drivers, retrieving any image > 64K only returned
    4KB. Now I'm getting the correct number of bytes back, but images >
    64K still give me the broken image icon, even though it does seem to
    know how large the image is supposed to be. Images < 64K continue to
    display just fine.

    I am at my wits end. I had to learn ASP for this project and I really
    don't know where to go from here. Everything I've found on the web
    makes it sound like this should be idiot simple. I've tried as many
    varations of AppendChunk and GetChunck as I can think of. I'm not even
    sure if the problem is during storage or retrieval.

    Any advice/help will be greatly appreciated.

    -Sean
    Sean Guest

  2. Similar Questions and Discussions

    1. oracle mx stored procedure
      "Error Executing Database Query. Incorrect parameter bindings for stored procedure call. Check your bindings against the stored procedure's...
    2. Oracle Stored Proc
      How do I catch the oracle error code when executing a stored proc in CF? I am running 9i. Thanks Norm
    3. BLOBs in Oracle
      I need to store and retrieve BLOBs in Oracle 10 through CFMX. Can someone provide sample code for how I can do that? (i.e., CFQUERY and related...
    4. oracle, asp, stored procedure
      I am trying to run a stored procedure from an asp page on an oracle 9i db. The stored procedure will take one parameter and should return two...
    5. perl dbi oracle and blobs
      dominant wrote: I would suggest you read: perldoc DBI and perldoc DBD::Oracle -- $a=24;split//,240513;s/\B/ => /for@@=qw(ac ab bc ba cb ca...
  3. #2

    Default Re: Can't display images stored as Oracle BLOBs

    To use BLOBs effectively, you have to use the GetChunk() method pr an
    ADODB.Stream object. You should be able to find some examples on the net.

    --
    Gregory A. Beamer
    MPV; MCP: +I, SE, SD, DBA

    ************************************************** ********************
    Think outside the box!
    ************************************************** ********************
    "Sean" <sean-h@bigfoot.com> wrote in message
    news:ab5d5ddb.0309030941.105f7707@posting.google.c om...
    > I have been fighting with storing/retrieving images in an Oracle
    > database using ASP for over a month now. I have been able to store
    > images < 64K w/ no problems. However, images > 64K have been a problem
    > since day one. We've updated our ODBC drivers and it appears that
    > images > 64K are being stored ... well, more correct than before.
    > Prior to the new drivers, retrieving any image > 64K only returned
    > 4KB. Now I'm getting the correct number of bytes back, but images >
    > 64K still give me the broken image icon, even though it does seem to
    > know how large the image is supposed to be. Images < 64K continue to
    > display just fine.
    >
    > I am at my wits end. I had to learn ASP for this project and I really
    > don't know where to go from here. Everything I've found on the web
    > makes it sound like this should be idiot simple. I've tried as many
    > varations of AppendChunk and GetChunck as I can think of. I'm not even
    > sure if the problem is during storage or retrieval.
    >
    > Any advice/help will be greatly appreciated.
    >
    > -Sean

    Cowboy \(Gregory A Beamer\) Guest

  4. #3

    Default Re: Can't display images stored as Oracle BLOBs

    I am using GetChunk. If I right click and save the target to disk, the
    resulting file opens and displays just fine in any photo viewer of
    choice. However, if I click on the link to display the image in the
    browser, I get a broken image icon. It seems very odd to me that this
    should happen only with images > 64K. Is there some quirk to
    ASP/BinaryWrite I should be aware of?

    This is my code. As you can see I've tried writing the image data as
    one block and breaking it up using GetChunk. I've also tried different
    chunk sizes. Nothing works if the image is > 64K.

    -Sean

    <%
    dim objConn
    DBObjConn() 'Open database
    id = Request.QueryString("id")

    cmdsql = "SELECT vcfiletype, imagedata from pictures_blob WHERE
    vcpartnumber ='"&id&"'"
    set rs = objConn.execute( cmdsql )

    Response.Expires = 0
    Response.Buffer = TRUE
    Response.Clear

    Response.ContentType = rs("vcfiletype")

    'temp = rs("imagedata")
    'Response.BinaryWrite temp
    Do
    temp = rs.Fields("imagedata").getChunk(1024)
    If isNull( temp ) Then Exit Do
    Response.BinaryWrite temp
    Loop

    rs.close
    Response.End
    %>


    "Cowboy \(Gregory A Beamer\)" <NoSpamMgbworld@comcast.netNoSpamM> wrote in message news:<#BWmPBNdDHA.904@TK2MSFTNGP11.phx.gbl>...
    > To use BLOBs effectively, you have to use the GetChunk() method pr an
    > ADODB.Stream object. You should be able to find some examples on the net.
    >
    > --
    > Gregory A. Beamer
    > MPV; MCP: +I, SE, SD, DBA
    >
    > ************************************************** ********************
    > Think outside the box!
    > ************************************************** ********************
    > "Sean" <sean-h@bigfoot.com> wrote in message
    > news:ab5d5ddb.0309030941.105f7707@posting.google.c om...
    > > I have been fighting with storing/retrieving images in an Oracle
    > > database using ASP for over a month now. I have been able to store
    > > images < 64K w/ no problems. However, images > 64K have been a problem
    > > since day one.
    Sean Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139