Loading an image from a stream

Hello,
I am trying to load several images into the database from a
ZipInputStream.
When I use the the loadDataFromInputStream method the first
image loads properly. But when I try to extract the next zipped
file from the stream I get an error saying the stream has been
closed.
Has anyone else had this problem? No of any fixes?
I am going to write the zipped images out the filesystem and
then reload them but that seems like a big waste of time and
resources.
Help please,
Abel Rauch

The current implementation of loadDataFromInputStream() closes
the InputStream after the content gets loaded.
You may have to write a CustomInputStream class which extends
from the ZipInputStream. Then override the close() method to do
nothing or call getNextEntry(). You should be able to use this
CustomInputStream in loadDataFromInputStream().
richard

Similar Messages

  • Error While loading a image from database

    Purpose
    Error While loading the Image from the database
    ORA-06502: PL/SQL : numeric or value error:Character string buffer too small
    ORA-06512: at "Sys.HTP" ,line 1480
    Requirement:
    I am developing the web pages using PSP(Pl/sql Serverpages) . I have a requirement to show a image in the webpage. I got the following procedures from the oracle website.
    I have created the following table to store the images
    create table DEMO
    ID INTEGER not null,
    THEBLOB BLOB
    And I also uploaded the Images. Now I am try to get a image from the table using the following procedure .But I am getting the error message line 25( htp.prn( utl_raw.cast_to_varchar2( l_raw ) );) .at it throws the following error messages
    ORA-06502: PL/SQL : numeric or value error:Character string buffer too small
    ORA-06512: at "Sys.HTP" ,line 1480
    Procedure that I used to get the image
    create or replace package body image_get
    as
    procedure gif( p_id in demo.id%type )
    is
    l_lob blob;
    l_amt number default 30;
    l_off number default 1;
    l_raw raw(4096);
    begin
    select theBlob into l_lob
    from demo
    where id = p_id;
    -- make sure to change this for your type!
    owa_util.mime_header( 'image/gif' );
    begin
    loop
    dbms_lob.read( l_lob, l_amt, l_off, l_raw );
    -- it is vital to use htp.PRN to avoid
    -- spurious line feeds getting added to your
    -- document
    htp.prn( utl_raw.cast_to_varchar2( l_raw ) );
    l_off := l_off+l_amt;
    l_amt := 4096;
    end loop;
    exception
    when no_data_found then
    NULL;
    end;
    end;
    end;
    What I have to do to correct this problem. This demo procedure and table that I am downloaded from oracle. Some where I made a mistake. any help??
    Thanks,
    Nats

    Hi Satish,
    I have set the raw value as 3600 but still its gives the same error only. When I debug the procedure its throwing the error stack in
    SYS.htp.prn procedure of the following line of code
    if (rows_in < pack_after) then
    while ((len - loc) >= HTBUF_LEN)
    loop
    rows_in := rows_in + 1;
    htbuf(rows_in) := substr(cbuf, loc + 1, HTBUF_LEN);
    loc := loc + HTBUF_LEN;
    end loop;
    if (loc < len)
    then
    rows_in := rows_in + 1;
    htbuf(rows_in) := substr(cbuf, loc + 1);
    end if;
    return;
    end if;
    Its a system procedure. I don't no how to proceed .. I am really stucked on this....is their any other method to take picture from the database and displayed in the web page.....???? any idea..../suggesstion??
    Thanks for your help!!!.

  • JAVA, sqlserver - Need to load an image from the sql server database

    hi,
    I need to load an image from the sql server database using java. I have connected to the database and getting all other records except the records for a photo (datatype = LONGVARBINARY) and Remarks (datatype = LONGVARCHAR).
    I am using java and sql server db. The photo and remarks are stored in the db. and i need to show the image and the remarks fetching them from there.
    I get the error :
    Thread-9 org.hibernate.MappingException: No Dialect mapping for JDBC type: -1
    How can I achieve this?
    Thanks,
    Gargi

    Exactly. And are you using MySQL?
    No. You are using Microsoft SQL server if I have to believe your initial post. A quick google tells me that the dialect class to use is:
    org.hibernate.dialect.SQLServerDialect

  • Load multiple images from directory?

    What is the best way to use CF to load multiple images from a
    server directory please? I have CF calling a stored procedure that
    returns an array of file names. I am using a Flex front end, and
    wonder if I should just pass the file name array to Flex and let it
    loop through and load each image into an array. Or is it possible
    from within my CFC to use the file name array to get CF to grab the
    images and then pass that image array back to Flex? If so, is there
    any advantage to either approach? TIA,
    Mic.

    You don't want to pass the binaries to Flex, you should just
    give Flex the image names and load them via HTTP.

  • How can I best load RAW images from a Canon SX50?

    How can I best load RAW images from a Canon SX50?

    9Sorry, ........confused about this process.   When I attempted to Post the question I had entered, I was told a blank space could not be posted.  So, I reentered the Q in the "space"........ which apparently was the space for an answer....!! ??......)
    >  When I try to load RAW images taken by my Canon SX50 from the SD card, iPhoto 11 -  (iMac/OSX 10.6.8) tells me that it can't read the format or something like that.    OSX 10.6.8 came out before the SX50, thus, did not include the related program.           I want to shoot RAW on the SX50....... but I then want to load them into iPhoto....... which I do directly from pics I take with my Nikon D200.  
    Not sure if this will help.............

  • I can't down load my images from my Nikon D4 to Apeture.

    I can't down load my images from my Nikon D4 to Apeture.

    Hi skhart1998,
    I also use Nikon D4, D2H and D2Xs
    I use Nikon Transfert 2, the latest version, to download my shots to my MacBook Pro hard disk in a picture folder. After this I use Aperture Import to place the New folder created in the Nikon folder in the Aperture Inspector folder... This way, I always have the copy of my originals files.
    .jpg or .nef  work fine.
    Denis

  • Loading realscale image from memorycard.

    Hi.
    I made a big image (3550 x 2100 pixels), which my Nokia 6125 didn't zoom enough on the normal Picture preview.
    So I decided to make a program for it, so I could see all the details from the pic, and move around on the image. (Like zoom, but I need to get closer.. )
    First problem i encountered, was that 4mb application was too big to install on my memorycard... Darn limits...
    So I decided to add them seperately, that I'd load the image from the application.
    Well when I ran the "File Browser", there was 3 things:
    - ".." (Folder up)
    - "E:\" (crashes, no access)
    - "C:\" (crashes, no access)
    So any ideas how could I get it work properly?
    Thanks!

    hmm ... ok .. that sounds good .. but that means that
    a servlet must exsist at all time to display the
    required image.Servlets are usually instantiated by the servlet container upon an incoming request.

  • Loading an image from an arbitrary URL without using an ImageIcon

    Can anybody maybe point me in the direction of other (as in harder-to-use, but more flexible) ways to load an image from a URL?

    Interesting results:
    When I run this test code (the names have been changed to protect the innocent):
    package graphicstest;
    import javax.swing.*;
    import java.net.*;
    import javax.imageio.*;
    import java.awt.image.*;
    * <p>Title: </p>
    * <p>Description: </p>
    * <p>Copyright: Copyright (c) 2007</p>
    * <p>Company: </p>
    * @author not attributable
    * @version 1.0
    public class Foo
        extends JFrame {
      static ImageIcon ii;
      public Foo() {
        setSize(200,200);
        try {
          System.out.println("2=aborted; 8=complete; 4=errored; 1=loading");
          ii = new ImageIcon(new URL("http://intranet/part?FOO.JPG"));
          System.out.println("image load status: " + ii.getImageLoadStatus());
          getContentPane().add(new JLabel(ii));
          System.out.println("image load status: " + ii.getImageLoadStatus());
        }catch(Throwable t) {t.printStackTrace();}
      public static void main(String args[]) {
          Foo foo = new Foo();
          foo.setVisible(true);
          if (ii.getImageLoadStatus() == 4) {
            try {
              BufferedImage bi = ImageIO.read(new URL(
                    "http://intranet/part?FOO.JPG"));
              ii.setImage(bi);
              foo.validate();
              foo.repaint();
            } catch(Throwable t) {t.printStackTrace();};
    }. . . from a box that's not on the VPN, it blows up at the ImageIO.read() call (not unexpectedly). But if I run it from a box that's on the VPN, and able to access the URL, then it returns just fine from the ImageIO.read(), and I get a null pointer exception at the call to setImage().
    Clearly, this is trying to tell me SOMETHING, but I don't quite know WHAT.
    JHHL

  • Loading an image from CameraRoll - how long should it take ?

    Hi All
    I'm loading an image from the CameraRoll using this method http://www.flashandmath.com/mobile/cameraroll/
    Now on my iPad2 the image loads pretty instantaneously
    However on my iPhone4 it takes approx 8 seconds for the image to load.
    ( The time is taken after calling loader.loadFilePromise waiting for Event.COMPLETE ... i.e. the image to load )
    function onImgSelect(event:MediaEvent):void {
    var promise:MediaPromise = event.data as MediaPromise;
    removeBrowseListeners();
    loader = new Loader();
    loader.contentLoaderInfo.addEventListener(Event.COMPLETE, onImageLoaded);
    loader.contentLoaderInfo.addEventListener(ErrorEvent.ERROR, onError);
    loader.loadFilePromise(promise);
    The code base is the same. There are (at least) 2 differences :-
    1) The hardware (iPad vs phone)
    2) The number of images on the camera roll (approx 60 on iPad vs almost 900 on the phone)
    Has anyone else noticed such a difference in speed between devices / number of files ?
    Is there a better/quicker way to load an image from CameraRoll ?
    Is 8 seconds normal/acceptable (I show a busy indicator)
    Any help / suggestions/ observations most appreciated !

    If you opted for the Secure Erase and the account has a lot of data in it, then it could take days to complete.

  • Loading an Image from the database and display it on browser

    I do not know if this is even possible.
    At the moment, to load an image inside an Html page you need to use the <img src=""> tag. and in the src you put the path of the image. Now I would like to save an image inside the database.
    An option to still display the image on the browser would be that my service object, would load the object from the database (saved as blob) then save it somewhere on the Server, and the still use the <img> tag to load the image from that location.
    However I was wondering wheather there is another way to do it without saving this image on the server. that is loading the bytes from the database (or a location on the server) and provided these bytes to the jsp page to display the image.
    Is this possible? or?
    regards,
    sim085

    hmm ... ok .. that sounds good .. but that means that
    a servlet must exsist at all time to display the
    required image.Servlets are usually instantiated by the servlet container upon an incoming request.

  • To load the image from appl. server to FORM

    Hi all,
    i have to fetch the image from Application server and Print in a form. i don't know how to load the image from appl. server to FORM.Through SE78 i guess we can load the image only from presentation server,,,,can anyone help on this????

    Hi Bhuvaneshwari ,
    Through <b>SE78</b> you can fetch the image from application server.
    Goto><b>Graphics</b>><b>BMAP(Bit map images)</b>>In <b>Name</b> parameter click <b>F4</b> for input help.>click on <b>execute</b> button.
    These images are stored on document server.
    There you can find images of application server.
    Those images you can import.
    Reward if helpful.
    Regards,
    Sandhya.

  • Firefox won't load check images from my online bank.

    Firefox won't load check images from my online bank. It had been doing so with no problems, but stopped 2 days ago. I can get into my account and navigate with no problems. But when I click to see the image of a check, I get a blank page.
    I am using Firefox 3.6, but I have the same problem on my laptop with Firefox 4
    It works fine with Safari and Internet Explorer.

    If you can't open them in Firefox anymore (you seem to have a plugin: View PDF documents within your web browser) then download the documents to the desktop and open them with a program that can open PDF files.
    See also to be sure that that plugin is still selected:
    * https://support.mozilla.com/kb/Managing+file+types
    Do you otherwise have problems with PDF files?

  • Image from a stream

    I need a way to produce an empty image, display it, and then fill it in from a stream being loaded in another thread. I am working on a web browser-like tool, and I need to be able to do this in order to get multiple images loading at the same time.
    Can anyone help me with how to do this?

    No real solution, but interesting...
    http://forums.java.sun.com/thread.jsp?forum=54&thread=96843
    sentence at the bottom
    http://java.sun.com/docs/books/tutorial/uiswing/painting/improvingImageAnim.html
    "Most of the time is taken up by initiating HTTP connections. Each image file requires a separate HTTP connection, and each connection can take several seconds to initiate"
    MediaTracker eems to use thread(s?), but don't think it's all at once. See waitForAll(time ms)
    http://java.sun.com/j2se/1.3.0/docs/api/java/awt/MediaTracker.html
    You might look at the source for this one.
    That's all can find now

  • When I try to load an image from the scanner, or from a file, into a bank deposit script, I get a message - "Error Java heap space". Need help to diagnose and fix this problem.

    I am running a script from my banking facility which asks me to load an image of the front and back of the check. I never had a problem before, but this time when I try to load the images either directly from the scanner, or from previously saved jpg files I get an error window message that says - Error Java heap space,
    Ed Marcato

    I am running a script from my banking facility which asks me to load an image of the front and back of the check. I never had a problem before, but this time when I try to load the images either directly from the scanner, or from previously saved jpg files I get an error window message that says - Error Java heap space,
    Ed Marcato

  • How to load a PDF from a stream

    Hi,
    I'm looking at how to load a PDF file from a stream in .NET, e.g. something like a MemoryStream or FileStream. All of the methods I've seen so far only allow the PDF to be loaded from a file which we don't want to do because of security issues. I know I can do this with a third party tool, but is this possible without using any additional tools?
    Cheers,
    Dave Harrington.

    > I have a feeling that removing the save button will not be possible.
    You cannot remove the save button, no, but you can replace its execute method with something that, say, pops up a warning to the user instead.
    > Is there any way to just load the file using a URL?
    The ActiveX control definitely loads a URL. See the "src" property of the ActiveX control. If you download the SDK, the ActiveView sample actually loads a PDF from a URL by default.

Maybe you are looking for