How to read some images from file system with webdynpro for abap?

Hi,experts,
I want to finish webdynpro for abap program to read some photos from file system. I may make MIMES in the webdynpro component and create photos in the MIMES, but my boss doesn't agree with me using this way. He wish me read these photos from file system.
How to read some images from file system with webdynpro for abap?
Thanks a lot!

Hello Tao,
The parameter
   icm/HTTP/file_access_<xx>
may help you to access the pictures without any db-access.
The following two links may help you to understand the other possibilities as well.
The threads are covering BSP, but it should be useful for WebDynpro as well.
/people/mark.finnern/blog/2003/09/23/bsp-programming-handling-of-non-html-documents
http://help.sap.com/saphelp_sm40/helpdata/de/c4/87153a1a5b4c2de10000000a114084/content.htm
Best regards
Christian

Similar Messages

  • How to read appended objects from file with ObjectInputStream?

    Hi to everyone. I'm new to Java so my question may look really stupid to most of you but I couldn't fined a solution by myself... I wanted to make an application, something like address book that is storing information about different people. So I decided to make a class that will hold the information for each person (for example: nickname, name, e-mail, web address and so on), then using the ObjectOutputStream the information will be save to a file. If I want to add a new record for a new person I'll simply append it to the already existing file. So far so good but soon I discovered that I can not read the appended objects using ObjectInputStream.
    What I mean is that if I create new file and then in one session save several objects to it using ObjectOutputStream they all will be read with no problem by ObjectInputStream. But after that if in a new session I append new objects they won't be read. The ObjectInputStream will read the objects from the first session after that IOException will be generated and the reading will stop just before the appended objects from the second session.
    The following is just a simple test it's not actual code from the program I was talking about. Instead of objects containing different kind of information I'm using only strings here. To use the program use as arguments in the console "w" to create new file followed by the file name and the strings you want save to the file (as objects). Example: "+w TestFile.obj Thats Just A Test+". Then to read it use "r" (for reading), followed by the file name. Example "+r TestFile.obj+". As a result you'll see that all the strings that are saved in the file can be successfully read back. Then do the same: "+w TestFile.obj Thats Second Test+" and then read again "+r TestFile.obj+". What will happen is that the strings only from the first sessions will be read and the ones from the second session will not.
    I am sorry for making this that long but I couldn't explain it more simple. If someone can give me a solution I'll be happy to hear it! ^.^ I'll also be glad if someone propose different approach of the problem! Here is the code:
    import java.io.*;
    class Fio
         public static void main(String[] args)
              try
                   if (args[0].equals("w"))
                        FileOutputStream fos = new FileOutputStream(args[1], true);
                        ObjectOutputStream oos = new ObjectOutputStream(fos);
                        for (int i = 2; i < args.length ; i++)
                             oos.writeObject(args);
                        fos.close();
                   else if (args[0].equals("r"))
                        FileInputStream fis = new FileInputStream(args[1]);
                        ObjectInputStream ois = new ObjectInputStream(fis);
                        for (int i = 0; i < fis.available(); i++)
                             System.out.println((String)ois.readObject());
                        fis.close();
                   else
                        System.out.println("Wrong args!");
              catch (IndexOutOfBoundsException exc)
                   System.out.println("You must use \"w\" or \"r\" followed by the file name as args!");
              catch (IOException exc)
                   System.out.println("I/O exception appeard!");
              catch (ClassNotFoundException exc)
                   System.out.println("Can not find the needed class");

    How to read appended objects from file with ObjectInputStream? The short answer is you can't.
    The long answer is you can if you put some work into it. The general outline would be to create a file with a format that will allow the storage of multiple streams within it. If you use a RandomAccessFile, you can create a header containing the length. If you use streams, you'll have to use a block protocol. The reason for this is that I don't think ObjectInputStream is guaranteed to read the same number of bytes ObjectOutputStream writes to it (e.g., it could skip ending padding or such).
    Next, you'll need to create an object that can return more InputStream objects, one per stream written to the file.
    Not trivial, but that's how you'd do it.

  • How to read bytes(image) from a server ?how to display image after read byt

    How to read bytes(image) from a server ?how to display image after reading bytes?
    i have tried coding tis , but i couldnt get the image to be display:
    BufferedInputStream in1=new BufferedInputStream(kkSocket.getInputStream());
    int length1;
    byte [] data=new byte[1048576];
    if((length1=in1.read(data))!=-1){
    System.out.println("???");
    }System.out.println("length "+length1);
    Integer inter=new Integer(length1);
    byte d=inter.byteValue();

    didn't I tell you about using javax.imageio.ImageIO.read(InputStream) in another thread?

  • How to read some lines from a text file using java.

    hi,
    i m new to java and i want to read some lines from a text file based on some string occurrence in the file. This file to be read in steps.
    we only want to read the file upto the first Occurrence of "TEXT" string.
    How to do it ,,,
    Kinldy give the code
    Regards,
    Sagar
    this is the text file
    dfgjdjj
    sfjhjkd
    ghjkdg
    hjkdgh TEXT
    ikeyt
    ujt
    jk
    tyk TEXT
    rukl
    r

    Hendawy wrote:
    Since the word "TEXT" is formed of 4 letters, you would read the text file 4 bytes by four bytes. Wrong on two counts. First, the file may not be encoded 1 byte per character. It could be utf-16 in which case it would be two byte per character. Second, even if it were 1 byte per character, the string "Text" may not start on a 4 byte boundary.
    Consider a FileInputStream object "fis" that points to your text file. use fis.read(byte[] array, int offset, int len) to read every four bytes. Convert the "TEXT" String into a byte array "TEXT".getBytes(), and yous the Arrays class to compare the equality of the read bytes with your "TEXT".getBytes()Wrong since it relies on my second point and will fail when fis.read(byte[] array, int offset, int len) does not read 4 bytes (as is no guaranteed to). Check the Javadoc. Also, the file may not be encoded with the default character encoding.
    The problem is easily solved by reading a line at a time using a BufferedReader wrapping an InputStreamReader wrapping a FileInputStream and specifying the correct character encoding.
    Edited by: sabre150 on Apr 29, 2009 2:13 PM

  • Without using webutil how to read an image from client or own system

    Hi,
    I am trying to read image from my own system.
    (if I click on button (browse) then it should open an dialog box then i can select image from it. then I press another button(save) it should be store in the database.)
    So, i want read image without using webutil package how to do it.
    If i want read image from client system please tell me how to do it.
    I am getting with webutil package but there is any other chance to get the image.

    Please keep in mind that Forms 10g is a release not a version.  Also, since you are running on Windows 7 64 bit - you should be using Forms 10g Release 2 (version 10.1.2.0.2) and a patchset to upgrade this to version 10.1.2.3.0.
    Now, to answer your question - I happen to agree with MarkReichman, WebUtil would be my preferred method, but since you don't want to use WebUtil then the only other way would be to use a 3rd party Java Bean.  I prefer WebUtil because it is supported by Oracle and I can contact them with any issues.
    Craig...

  • How to read an image from an file using jsp

    reading an image from an file present on local disk using jsp

    Server-local or client-local? First, File I/O, second: better get a new job.

  • How to read/write image from Microsoft Word

    Hello All,
    I have to replace an image from word(.doc) files.How to read/write images, can any body help me out.
    Thanks in Advance
    Harish Sohane

    harissohane wrote:
    Hi,
    Thanks a lot. if any body knows about it please let me know. waiting for reply.
    Thanks in AdvanceLooking at POI again, it doesn't let you write them, but it does let you read them.
    [A list of API's found in Google in 10 seconds.|http://schmidt.devlib.org/java/libraries-word.html]

  • How to read a string from file & assign the val to a variable in batch file

    Hi,
    How to read a string from a file and assign the value to a variable then return the value to the screen in windows batch file?
    Any suggestions?
    thanks.

    Unless this is a homework question then I don't see the purpose of doing this, but....
    You should be looking a the supplied package utl_file to get the string out of the file, dbms_output to display the string and then google windows batch/command files calling sqlplus to execute your program.
    Andre

  • How do I get images from Aperture into print shop for mac?

    Friends,
    I have Print Shop for Mac and Aperture. How do I get images from Aperture into Print Shop? I'musing managed images with previews. Is there any option besides exporting to the desktop and importing?
    Thanks!
    Steve

    if you have previews turned on in Aperture and they're all genereated, you can simply drag-n-drop them into any application (just about). drag-n-drop is essentially the same as copy/paste as long as the application is setup to accept "drops" onto its windows.
    otherwise, if you're running Leopard (10.5) as your version of Mac OS X, when you import (or whatever it is in PrintShop), you should get a file selection dialog. from here, scroll down the left-hand side bar set of icons. near the bottom is a group called "Media". click on the triangle to open the group, choose Photos, and from here you should see an Aperture icon. click this and you'll see your whole library (or at least the portion of it that you have previews generated for. select the photo you want and viola!
    scott

  • How to insert into table from a xml with XDE for java?

    want to insert into the oracle tables from the xml with XDE for java, some sample better. thank you.

    XML Document may be stored in a SQL database with XML SQL Utility.
    http://download-west.oracle.com/docs/cd/B13789_01/appdev.101/b10794/adx08xsu.htm#i1008168
    XML Document may be stored in a SQL database with Oracle XML DB.
    http://download-west.oracle.com/docs/cd/B13789_01/appdev.101/b10790/xdb03usg.htm#CEGFECFH

  • Open PFD from R/3 with WebDynpro for Java

    Hi All,
    Could any one of you please suggest on how to open a pdf from R/3 with a WebDynpro (JAVA) application. For example I was trying to display one PDF-Document from Records Management in my Web Dynpro.
    Does anyone have a good idea how to solve this problem? Thanks.
    regards
    Sharam

    Hi,
    Elobarate your question once again.
    your plannig to open the PDF in Webdynpro getting From r/3 system.
    Or you are getting the data from R/3 that data wanted to put in PDF.
    Let know clearly such we can go ahead.
    Thanks,
    Lohi.

  • Excel File Upload In Webdynpro For ABAP

    Hi All,
    I have a doubt regarding EXCEL file upload for Webdynpro for ABAP.
    I am able to get the path of file using 'FILEUPLOAD' UI element.Now I need to upload the EXCEL file into ALV.I have tried out with GUI_UPLOAD and other excel upload function module.But these Function Module throws Dump.
    Can you please suggest how to go about it.It will be a great help if u can suggest any function module or method.

    Hi Amita,
    Insetad of using GUI_UPLOAD use 'HR_KR_XSTRING_TO_STRING'
    Here is the sample code,
    TYPES :BEGIN OF str_itab,
                  name(10) TYPE c,
                  age(10) TYPE c,
                 END OF str_itab.
    DATA : t_table1 TYPE STANDARD TABLE OF str_itab,
           i_data TYPE STANDARD TABLE OF string,
                   lo_nd_sflight TYPE REF TO if_wd_context_node,
                    lo_el_sflight TYPE REF TO if_wd_context_element,
                    l_string TYPE string,
            fs_table TYPE str_itab,
                    l_xstring TYPE xstring,
    fields TYPE string_table,
    lv_field TYPE string.
    DATA : t_table TYPE if_main=>elements_data_tab,
    data_table TYPE if_main=>elements_data_tab.
      * get single attribute
    wd_context->get_attribute(EXPORTING name =  `DATASOURCE`  
                              IMPORTING value = l_xstring ).
    CALL FUNCTION 'HR_KR_XSTRING_TO_STRING'
    EXPORTING
    in_xstring = l_xstring
    IMPORTING
    out_string = l_string.
    SPLIT l_string  AT
    cl_abap_char_utilities=>newline INTO TABLE i_data.
      * Bind With table Element.
    LOOP AT i_data INTO l_string.
    SPLIT l_string AT cl_abap_char_utilities=>horizontal_tab INTO TABLE
    fields.
    READ TABLE fields INTO lv_field INDEX 1.
    fs_table-name = lv_field.
    READ TABLE fields INTO lv_field INDEX 2.
    fs_table-age = lv_field.
    APPEND fs_table TO t_table1.
    ENDLOOP.
    lo_nd_sflight = wd_context->get_child_node( 'DATA_TAB' ).
    lo_nd_sflight->bind_table( t_table1 ).
      ENDMETHOD.
    if correct give correct answer
    Thanks & Regards,
    Meenachi.R

  • How can we Access RFC of R/3 in WEBDYNPRO FOR ABAP?

    Hi all,
    i wnat to access a Function Module(RFC) which has created in R/3 in WEBDYNPRO FOR ABAP.Can i access it through SERVICE CALL.or if any other process there.?And how can i map their context & how can i execute?
    Edited by: ravi k on Mar 27, 2008 1:07 PM

    Hi,
    you can find a [pdf document|https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/9cb5d345-0801-0010-6a8e-fc57c23fd600] here.
    grtz,
    Koen

  • How to read some records from a text file into java(not all records)

    hello,
    how to read text files into java. i need only few records from the text file not all records at a time.
    If any one knows plz reply me
    my id is [email protected]

    this snipet reads a text file line by line from line 1 to 3
    try {
                  FileReader fr = new FileReader(directory);
                  BufferedReader br = new BufferedReader(fr);
                  int counter = 0;
                  while ((dbconn = br.readLine()) != null) {
                      switch(counter){
                          case 0:
                            status = dbconn;
                          break;
                          case 1:
                            userName = dbconn;
                          break;
                          case 2:
                            apword = dbconn;
                          break;
                      counter++;
                  br.close();
        }catch(IOException e){
        }

  • How to read screendump image from clipboard to a file

    I am trying to build a program that runs minimized while other programs are being used at the same moment. At certain moments I want to make a screenshot and save that information to a image file on the harddisk.
    I have now the "user32.dll" to work and generate a "printscreen" push button. Now I want to write the information on the clipboard to an image file.
    How can I read the information on the clipboard and use it in a VI?
    Thanks in advance.
    Ferry

    If the screen you want to capture is a VI, you should use Invoke Node -> Get Panel Image, and Write BMP File.vi.
    See attached VI.
    If the screen isn't made in LabVIEW, and it's minimized, printscreen can't catch it.
    To save the clipboard image to file, you can import the clipboard image into LabVIEW first
    (use Image Toolbox: http://www.geocities.com/gzou999/imgtool.htm), and then Write BMP File.vi
    George Zou
    http://gtoolbox.yeah.net
    George Zou
    http://webspace.webring.com/people/og/gtoolbox
    Attachments:
    Save Panel.vi ‏25 KB

Maybe you are looking for

  • OS 2.1.0.1032: internet over bridge stopped working after upgrade

    Hi Before the upgrade to 2.1.x, I was able to connect the bridge to my BB phone and then use the regular browser to connect to the internet (NOT the Bridge Internet Browser). I could also send and receive emails with my internet email accounts and -s

  • New Document Type Creation

    Hi, 1)can we create new document type?          for ex:   for goods receipt PO i want to create seperate document types like a)goods receipt PO- Stores b) goods receipt PO-Raw materials. 2)if i create UDF's in marketing documnet-rows they are display

  • Using s-video with 2 monitor setup

    I have the stock video card that came with my G5 and am running 2 monitors. I would like to connect my TV to my Mac through s-video but only know of the DVI to s-video adaptor that would require the removal of one of my monitors. I am aware that I ma

  • Sorting Playlist is a Challenge

    For some reasons I am not able to get the hang of sorting by multiple fields, for example, I have multiple playlists that I want sorted by Date Added descending, and within that by Album Example: Date Added 2009.09.15 Album A1 B1 C1 D1 Date Added 200

  • Multi Processors tuning in Oracle

    Hi, I have a quad Processors Sun machine with Oracle 8i. I did a CPU test by using Performance Monitor and found out that Oracle is only using One Processor. Does anyone know what I need to tune in Oracle to make Oracle uses all the processors? This