Problems showing image file using ShowProperty servlet

Hi there,
I´m having problems trying to show an image from the repository using ShowProperty servlet. My node is of type image and my repository is a Library Services enabled repository. When I try to show my node´s binary property "file" the servlet returns the following message "A Primary Property is not defined for Node:...". But checking the node´s ObjectClass I can see that the file property is defined as a primary property. Can somebody help me on this ?
tks,
George Earp

Hi Anders,
first thanks for trying to help me. Answering your questions in order: I certified myself that the node was saved and checked in using the Portal Administration site. I looked in debug mode and the Node is loaded correctly but the properties aren´t there. I have some more information for you. I decompiled the servlets (ShowBinaryServlet and ShowPropertyServlet). The news are that ShowBinaryServlet is a ShowPropertyServlet´s child that has no additional implementation. Other relevant information is that ShowPropertyServlet implementation gets the Node throught NodeOps object and try to get the binary property with it. But, reading the API and doing tests I could only get my Node properties throught a Virtual Node (see NodeOps Interface part of the API). That´s because my Repository is a managed repository. So, the servlets can´t find the bynary property in my Node because it isn´t there... It is under a VirtualNode... Am I right ? If that´s true I believe I´ll have to implement a solution myself... Too sad... :(
Message was edited by eduardo.earp at Jan 25, 2005 9:21 AM

Similar Messages

  • Problem with Image file

    Hi,
    Iam facing with one problem.I have one swing interface through which I can upload files(back end servlet programme).Now I can upload all types of file but problem with image file it uploading perfectly that means size of the uploaded file is ok but its format damaged.It can not be open.My backend servlet programme is ok coz i tested it with html form it is working perfectly.Problem with swing interface.Plz guide me where I done a mistake.Below r my codes:-
    ImageIcon Upload=new ImageIcon("images/Upload.gif");
         Button=new JButton(Upload);
         Button.setToolTipText("Upload");
    Button.addActionListener(new ActionListener()
    public void actionPerformed(ActionEvent e)
              int returnVal = fc.showOpenDialog(ActionDemo4.this);
              if (returnVal == JFileChooser.APPROVE_OPTION) {
              File file = fc.getSelectedFile();
    String aa=file.getAbsolutePath();
              textArea3.append(aa);
                   textArea2.append("Local URL:");
    long l=file.length();
              try
              byte buff[]=new byte[(int)file.length()];
              InputStream fileIn=new FileInputStream(aa);
              int i=fileIn.read(buff);
              String conffile=new String(buff);
              String str1=textArea10.getText();
    url = new URL ("http://127.0.0.1:7001/servletUpload?x="+str1);
         urlConn = url.openConnection();
         urlConn.setDoInput (true);
         urlConn.setDoOutput (true);
         urlConn.setUseCaches (false);
         urlConn.setRequestProperty("Content-Type","multipart/form-data;boundry=-----------------------------7d11e410e500f2");
         printout = new DataOutputStream (urlConn.getOutputStream ());
    String content ="-----------------------------7d11e410e500f2\r\n"+"Content-Disposition: form-data;"+"name=\"upload\"; filename=\""+aa+"\"\r\n"+"Content-Type: application/octet-strem\r\n\r\n\r\n"+conffile+"-----------------------------7d11e410e500f2--\r\n";
    printout.writeBytes(content);
    printout.flush ();
    printout.close ();
    Best Regards
    Bikash

    The errors are here:
              byte buff[]=new byte[(int)file.length()];
              InputStream fileIn=new FileInputStream(aa);
              int i=fileIn.read(buff);
              String conffile=new String(buff); (conffile is a String object containing the image)
    and here:
    String content ="-----------------------------7d11e410e500f2\r\n"+"Con
    ent-Disposition: form-data;"+"name=\"upload\";
    filename=\""+aa+"\"\r\n"+"Content-Type:
    application/octet-strem\r\n\r\n\r\n"+conffile+"--------
    --------------------7d11e410e500f2--\r\n";
    printout.writeBytes(content);conffie is sent to the server but
    it's non possible to treat binary data as String!
    Image files must be sent as byte[] NOT as String ......

  • Uploading image file using tcode se78  occuring some   Error

    Hai Gurus
          I am uploading image file using tcode se78 but while Uploading it giving some error i cant resolve the problem so any one help me plz
    Error    "Graphic LOGO could not be saved (2LOGO)"
    Regards
    Selvendran

    Hai
    Thanks
    I had done in all method but i can't save it 
    error is coming ..so plz help me to upload the image
    Error "Graphic LOGO could not be saved (2LOGO)"
    Regards
    Selvendran

  • How to upload a image file using JSP

    hello to all.
    i am in the learning stage please help me to upload a image file
    using jsp. give the explanation to the code also if possible.
    thanks in advance
    sincerely
    Chezhian

    You may find the following articles useful for the JSP/Servlet part:
    Uploading files: http://balusc.blogspot.com/2007/11/multipartfilter.html
    Downloading files: http://balusc.blogspot.com/2007/07/fileservlet.html

  • Showing tiff files using web.show_document

    Hello,
    I want to show tiff files using web.show_document. Tiff files cannot be displayed in a browser, however therr are several plug-ins available to show them.
    Can anyone recommend a plugin to display tiff files in a browser?
    Kind Regards Erik

    We had tried a different approach. We store all type of documents in the database using webutil.
    And we dont directly open any document and we download the document to the local host and then open it using webutil client host ('local folder\file name')
    This way word,excel, pdf etc will be automatically opened with its relevant appln and if there is relevant appln is not found it will prompt the windows standard Open with dialog box.
    Rajesh ALex

  • Best way to upload and store image file using struts

    Hello there,
    I'm having two choices for uploading image files(not huge image files) using struts a) to store the image in application server's directory
    b) to store the image files as BLOB in database.
    Although each of the image files have to be associated with unique ID to identify the image for re-display.
    Which is the best option. application server's directory or database
    josh

    I think storing it in the application server directory would probably allow for faster access, is easier to code, and doesn't depend on db connectivity.
    As for the unique id, you could probably use the File.createTemporaryFile method--it returns a unique id for every file in a directory, given a prefix & suffix. You just have to remember to change the extension from a .tmp to the image format you're using.
    Anyway, that's my 2 cents.

  • Problem in downloading file using servlet

    Hello,
    I wnat to send a file throung servlet to my desktop program. when i call this servlet through internet explore it is working fine but when i call this in my desktop program then desktop program get nothing. my desktop program does not get anything. please help me. here is my both code servlet and desktop program.
    public void doGet(HttpServletRequest request, HttpServletResponse response)
                   throws ServletException, IOException {
              response.setContentType("text/html");
         //     PrintWriter out = response.getWriter();
              File filename = new File("");
    //          Set the headers.
              response.setContentType("application/x-download");
              response.setHeader("Content-Disposition", "attachment; filename=" + filename);
    //          Send the file.
              OutputStream out = res.getOutputStream( );
              returnFile(filename, out); // Shown earlier in the chapter
              String filePath = getServletContext().getRealPath("/");
              response.setContentType("application/x-download");
              response.setHeader("Content-Disposition", "attachment; filename="+"amit.doc");
         //     File tosave = new File(getServletContext().getRealPath("), cfile.getName());" +
              try{
              File uFile= new File(filePath);
              int fSize=(int)uFile.length();
              FileInputStream fis = new FileInputStream(uFile);
              PrintWriter pw = response.getWriter();
              int c=-1;
    //          Loop to read and write bytes.
    //          pw.print("Test");
              while ((c = fis.read()) != -1){
              pw.print((char)c);
    //          Close output and input resources.
              fis.close();
              pw.flush();
              pw=null;
              }catch(Exception e){
    public class AdDesktopClient {
         * @param args
         public static void main(String[] args) {
              try{ 
              URL url = new URL("http://localhost:8080/WebRoot1/servlet/Download");
              //URLEncoder.encode(xmlString);
              URLConnection connection = url.openConnection();
              HttpURLConnection con = (HttpURLConnection)connection;
              con.setDoInput(true);
              con.setDoOutput(true);
              con.setUseCaches(true);
              con.setRequestMethod("GET");
              // PrintWriter out = new PrintWriter(con.getOutputStream());
              BufferedReader in = new BufferedReader(new InputStreamReader(connection.getInputStream()));
              String inputLine;
              int len = con.getContentLength();
              InputStream inn = con.getInputStream();
              byte[] buf = new byte[128];
              int c =0;
              System.out.print("len :"+len);
              System.out.print(inn.read());
              while( (c = inn.read())!= -1){
                   System.out.print(c);
    /*          while ((inputLine = in.readLine()) != null)
              System.out.println(inputLine);
              in.close();
              }catch(Exception e){
                   e.printStackTrace();
    Plaease help me to solve this problem. i want to send a file throuhg a servlet to my desktop program.
    Thanks in advance
    Ravi

    Give this a try:
    File strFile = new File(strFileName);
    long length = strFile.length();
    response.setContentType("application/octet-stream");
    response.setContentLength((int)length);
    response.setHeader("Content-Disposition", ("attachment; filename=" + strFileName));
    OutputStream out = response.getOutputStream();
    BufferedInputStream in = new BufferedInputStream(new FileInputStream(strFile));
    int i = -1;
    while((i = in.read()) != -1) out.write(i);
    in.close();
    Kris

  • Problem with Image File in Encore CS5

    I made a 6 GB Image File in order to make BluRay discs without having to open Encore each time.  I can't seem to find software that will allow me to use the file to burn the disc.  Simple copy/paste doesn't work either.  The problem may be that the image file has no file extension.  Checking properties in Windows 7, where the file extension is usually displayed, it just says "file". Can anyone explain why Encore is exporting a file with no file extension (like .iso, for example), and how to get around this issue?
    Thanks.
    Steve Siegel
    [email protected]

    Encore creates a bluray image with an iso extension. I wonder if you have windows explorer set to show no extension.
    You may not have "iso" associated with a program on your computer.
    Also, you cannot burn the "file" to a BD and have it play. You need a program to take the image and burn it in the correct bluray format onto the disk.
    Most of us love imgburn:
    http://www.imgburn.com/

  • How to handle image files used in PDF forms

    With LiveCycle, I've created an interactive form for Help Desk-type requests, and the form works beautifully. I've tested it, and everything works. Show. Hide, Clear fields. And all the other behaviors I added with Action Builder.
    As a final design feature, on my local machine at work, I added a header image (which is in My Documents>My Pictures). I tested locally and uploaded the form to Sharepoint and tested from there, and from what I can remember, the form looked fine. The header was intact. So I kind of assumed the image was embedded somehow.
    So I brought the file home and opened it there, and -- Voila! -- no header image!
    What happened?
    Does the image file need to be uploaded and the path relative to the location of the file? To me, this doesn't seem to be a huge problem. More of an unexpected one. I can probably upload the image to someplace in Sharepoint and then set the image path in the XML.
    But I'd like to hear the experiences of those who have used image files in their LiveCycle forms.
    Message was edited by: ashish gupta. to make the title more descriptive and added some tags.

    In the Object palette make sure Embed Image Data is ticked.

  • Problem with image file (URGENT!!!!!!!!!!)

    Hi all,
    I'm using oracle 6i and in my program I use an activeX for generating barcodes..
    the activeX genrate an image file and i need to store it in db(oracle 9i) or at least show the generated image through my form...the problem I encounter is that the read_image_file built in does not read the barcode images while it reads and shows other pictures with the same type (ex. tif or jpg)...
    here is my code (in case if it is useful) :
    declare
    application ole2.obj_type;
    begin
    application := ole2.create_obj('IDAuto.BarCode.1');
    ----DataToEncode :this is the data that is to be encoded in the barcode
    ole2.set_property(application,'DataToEncode',:txt);
    IDAuto_IBarCode.SetPixelsXY(application,2048,1024);
    ----this method save the image file
    IDAuto_IBarCode.SaveEnhWMF(application,'d:\TEST.tif');
    :system.message_level := '25';
    Read_Image_File(,'d:\TEST.tif','TIFF', 'control.itm_image');
    :system.message_level := '0';
    end;

    The errors are here:
              byte buff[]=new byte[(int)file.length()];
              InputStream fileIn=new FileInputStream(aa);
              int i=fileIn.read(buff);
              String conffile=new String(buff); (conffile is a String object containing the image)
    and here:
    String content ="-----------------------------7d11e410e500f2\r\n"+"Con
    ent-Disposition: form-data;"+"name=\"upload\";
    filename=\""+aa+"\"\r\n"+"Content-Type:
    application/octet-strem\r\n\r\n\r\n"+conffile+"--------
    --------------------7d11e410e500f2--\r\n";
    printout.writeBytes(content);conffie is sent to the server but
    it's non possible to treat binary data as String!
    Image files must be sent as byte[] NOT as String ......

  • Inconsistency problem with Image preview using ImageServlet -JSP

    I have a Servlet that reads Images ( JPG) from file system and sends bites to response,
    Code works fine and I can see the Image, Problem is that it is very Inconsistent sometimes I can see image and sometimes I see the red X mark instead of image,
    if I refresh the page wih shift key holding, the image shows up.
    when the image was obsent I can right click the image and go to properties and see the image path and it was correct.
    any one has similar experiences with Images before ?
    Servlet code follows.
    File f = new File(imgPath);
    BufferedInputStream in = new BufferedInputStream(new FileInputStream(f));
    // Set all the required header information
    response.setContentType("image/gif");
    response.setContentLength((int)f.length());
    response.reset();
    response.resetBuffer();
    BufferedOutputStream out = new BufferedOutputStream(response.getOutputStream());
    byte[] buf = new byte[1024];
    int nRead;
    while( (nRead=in.read(buf)) != -1 ){
          out.write(buf,0,nRead);
    / Close up all our resources
    out.flush();
    in.close();
    response.flushBuffer();JSP code in pieces.
    <% response.setHeader("Cache-Control","no-cache");
       response.setDateHeader("Expires", -1);
       response.setHeader("Pragma", "no-cache");
       response.addHeader("Cache-control", "no-store");
       response.addHeader("Cache-control", "max-age=0");
    %>
    <html:html>
    <head>
    <META HTTP-EQUIV="PRAGMA" CONTENT="NO-CACHE">
    </head>
    <body>
    <img src="<%=request.getContextPath()%>/imageServlet?imgType=badge&imgName=<bean:write name='badge' property='name'/>" width="136" height="136" alt="" border="0">
    </body>
    <head> <META HTTP-EQUIV="PRAGMA" CONTENT="NO-CACHE"> </head>
    </html:html>Thanks
    Narendra

    Hi Peter,
    Thanks for your e-mail.And sorry for late.
    I have changed my activex server in my labview programme.Current 
    server name is XVideoOCX.I have attached 1 example.Still I am facing
    the same problem that I am not getting disply from more than 1 web
    cam.So would you be able to advice me,what should I do regarding this
    matter.
    Actually,This is a part  of my M.Sc project.I am under pressure.Peter,Please do me  this fevour.
    Thanks
    Kabir
    1 eample from help file:
    Video Disply
    1. Choose the input mode (Video, Single Image Files, Screen, etc.)
    XSetInputMode(0) // This
    chooses video as input
    2. Choose the video device
    XSetVideoInput(0) //
    Choose the first available video input device
    3. Initialize XVideoOCX
    XInit() // Initialize
    XVideoOCX
    4. Start internal video capture
    XStart()
    now XVideoOCX should display the live video
    5. Stop internal video capture
    XStop()
    6. Close XVideoOCX
    XClose()
    Kabir mamun
    PhD Student,DCU
    [email protected]
    www.iward2010.blogspot.com
    Attachments:
    ax2.vi ‏23 KB

  • Swapping Macs, can't change the image file used for TM to a Time Capsule

    Hello ~
    I have ten Macs connected to one TimeCapsule (TC) and nine of them work flawlessly performing a TimeMachine (TM) backup. On the one that doesn't work properly, it is a PBP with Leopard 10.5.8, and latest updates. The other Macs are mixed 10.5.x and 10.6.x.
    I had a user on the PBP that I had been backing up in the past. I erased the HD and reinstalled the OS, and then created a new account. I wanted to start backing up the new account and have the name of the backup be the new name I put under Sharing Preference (I assume that's where TM gets the name of the backup).
    Well, apparently not, the name of the backup is still the old user name from Sharing, and on the old account before the computer was erased.
    I have repaired permissions, I have thrown out the TM prefs in Mac HD\Library\Preferences\, I have restarted the computer. So far I can not get the name to change on the sparse image that it copies to, even though TM says the backup completed without error.
    So, as it appears the backup is using the same old image file that this Mac had been using, the backup are separate when you go into TimeMachine, they do not seem to access each other's data, and inspecting the contents of the image, the date of the backup file is there for the new user in the old image file.
    I really would just like the PBP to stop using the old image file and create it's own image.
    Any ideas welcome!
    Thanks all
    Chaz

    I'm slightly confused. What is a PBP or did you mean a MacBook Pro (MBP)? And, what do you mean by a backup "image?" TM does not make images. Are you actually referring to the backup folder for this machine?
    If I understand correctly what you need to do is delete the old backup for this machine so TM can start from scratch with a new backup. To do that open the TM application and select your backup, then from the Finder's tool icon in the toolbar select "Delete." which should delete the entire backup.
    Also, see User Tips for Time Machine for help with TM problems. Also you can select Mac Help from the Finder's Help menu and search for "time machine" to locate articles on how to use TM. See also Mac 101- Time Machine.

  • Problem with image control using more than 1 web cam

    Hi,
    I am using logitech quickcam pro 4000.Actually I want to get image from
    3 web cam at a time wich will act as a CCTV.I want to get picture from
    more than 1 web cam at a time.But,When I start the .vi,than I get image
    from 1 web cam.I have attached the vi and the demonstration file.
    If anyone  has any idea please send me a reply.
    (The code was constructed using information
    from the Logitech Software Development Kit, downloaded from the Logitech web
    site January 4th 2004.  This
    package includes the royalty free distribution with the camera driver.
    To install the package, download and unzip
    LabVIEW Logitech UWA.zip and run Setup.exe in the 'redist' folder.  This installs drivers (if not already
    installed).  Then run LabVIEW and open
    Logitech Image Acquisition Master.vi. 
    Click the LabVIEW run button.
    Notes for Understanding the Code
    [1] The camera is controlled by an Active-X
    reference from a front panel Acitve-X container that displays the pre-view
    image.  To create this, create a blank
    Active-X container on the front panel and select the Active-X Hydra Video
    Portal class.
    [2] Three methods are called, following the
    Visual Basic guide from Logitech.  The
    first establishes a connection to the Active-X server.  The status bar is activated in the preview
    window (EnableUIElements), and we connect a camera (ConnectCamera2).
    [3] Here we set the value of property
    'EnablePreview' to turn on the preview panel.
    [4] We can get the camera description for
    camera zero here (the first camera connected).
    [5] Here we select the video format (64x480
    – can change it later).  The next call
    establishes the preview size by setting property values.  The preview size should be the same as the
    video format for fastest image acquisition.
    [6] We are restricted to saving the picture
    to a BMP file and then reading it in again. 
    This is a limitation of the SDK. 
    After reading the image file we can change it to a JPG if we wish to.
    [7] Here we re-read the image file and
    provide it to ImageDisplay.vi.
    Other methods and property values are
    reasonably self evident.  In LabVIEW, if
    you right click the Active-X reference terminal on any method, you can create a
    new method by simply selecting the appropriate one from a list.  The parameters for the method appear
    automatically and should be reasonably self-evident from the names.  If you want more details, download the SDK
    from Logitech.
    Other methods allow you to make movies in
    real-time or time-lapse sequences.
    Note that you can also monitor Active-X
    events to detect inputs or parameter changes made elsewhere.  For example it is possible to detect when
    the button on the camera is pressed.)
    Thanks
    Kabir
    Kabir mamun
    PhD Student,DCU
    [email protected]
    www.iward2010.blogspot.com
    Attachments:
    Logitech Image Acquisition Master.vi ‏98 KB

    Hi Peter,
    Thanks for your e-mail.And sorry for late.
    I have changed my activex server in my labview programme.Current 
    server name is XVideoOCX.I have attached 1 example.Still I am facing
    the same problem that I am not getting disply from more than 1 web
    cam.So would you be able to advice me,what should I do regarding this
    matter.
    Actually,This is a part  of my M.Sc project.I am under pressure.Peter,Please do me  this fevour.
    Thanks
    Kabir
    1 eample from help file:
    Video Disply
    1. Choose the input mode (Video, Single Image Files, Screen, etc.)
    XSetInputMode(0) // This
    chooses video as input
    2. Choose the video device
    XSetVideoInput(0) //
    Choose the first available video input device
    3. Initialize XVideoOCX
    XInit() // Initialize
    XVideoOCX
    4. Start internal video capture
    XStart()
    now XVideoOCX should display the live video
    5. Stop internal video capture
    XStop()
    6. Close XVideoOCX
    XClose()
    Kabir mamun
    PhD Student,DCU
    [email protected]
    www.iward2010.blogspot.com
    Attachments:
    ax2.vi ‏23 KB

  • Saving PDF files as image files using the Preview application

    I'm converting PDF files into image files for use with OCR software. The problem is that changing the pixels/inch option from 150 to say 300 does not improve the resolution of the resulting image file. E.g. if I save at 150 p/i and then 300p/i both image files are the same size and resolution. I've tried JPG, JPG-2000, TIFF, and GIF. All produce the same fuzzy result. What am I doing wrong?

    The schematic file is made up from vector graphics. There are no images embedded in it. For some reason the OCR software (PDF pen) will not recognize the vector drawn characters near the various components. e.g. There may be a resistor with "R5" written next to it. This is the resistors designator. The designator is what I am trying to do the search on. Since PDF pen can perform OCR on scanned (image) documents I thought that turning the PDF schematic into an image file e.g. JPG using Preview would do the trick. Unfortunately as I have already mentioned I can not seem to get Preview to improve the resolution on the resulting image file - the OCR software struggles to recognize any print.

  • Downloadable .tiff files open in quicktime, not as an image file: using mac

    I am using a Mac 10.6.3 and
    Ffirefox ver: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2) Gecko/20100115 Firefox/3.6
    downloadable .tiff files open in firefox quicktime, not as image files, nor do they let me choose how to download or where to save or as what type of file.

    Hello andrea,
    You can tell Firefox to ask you where to store your download files by changing the Firefox "Preferences". You can get the instructions on how to do it in this article: [[Downloads window]].
    I would advise you to download tiff files as tiff files only otherwise they may become unviewable.
    Now, to open your tiff files as images, you can change the settings on your Mac computer as follows:
    #Select the tiff image that you downloaded.
    #Right click on it and select "Get info"
    #A windows will pop up. In this window, select the "Open with" item. Under this item, select "Preview" or any other image viewer application that you want to use.
    #Next, click on the "Change All.." button. Click "Continue" in the message that is shown.
    That's all. Now, your tiff files will open as images in the application that you just selected
    Hope this solves your problem !

Maybe you are looking for