How to list the umages from server system

Hi,
I am using tomcat. while clicking on a link in my application it will invoke the swing file. in that file i have to list out the images from my server.
While accessing our application it retrives from the local system images not from server...
What is the code for retrieving images from system?

Just try this out
i dont' know if u asked for this
import the necessary classes
client:
public class Client
public static void main(String args[]) throws Exception
Socket s = new Socket("197.0.0.1", 1000);
PrintStream ps = new PrintStream(s.getOutputStream());
ps.println("hello.txt");
ObjectInputStream ois = new ObjectInputStream(s.getInputStream());
byte[] buffer = new byte[ois.available()];
buffer = (byte[])ois.readObject();
FileOutputStream fos = new FileOutputStream("hello.txt");
fos.write(buffer);
Server
public class Server
public static void main(String args[])
ServerSocket ss = new ServerSockt(1000);
Socket s = ss.accept();
BufferedReader br = new BufferedReader(new InputStreamReader(s.getInputStreamReader()));
String fname = br.readLine();
FileInputStream fis = new FileInputStream(fname);
byte[] buffer = new byte[fis.available()];
fis.read(buffer);
ObjectOutputStream oos = new ObjectOutputStream(s.getOuputStream());
oos.writeObject(buffer);
}

Similar Messages

  • How to take the data from sage system to sap r/3

    hi expects,
              how to take the data from sage system to sap r/3? which adapter is to be used?what is the format of data in sage system?how the scenarios will work ? please help me in solving this problem?

    hi rohit,
    the data transfer can be done by using SOAP adapter
    do chk this link
    http://www.sage.org/lists/sage-members-archive/2001/msg01718.html
    http://www.sage.org/lists/sage-members-archive/2001/msg01739.html
    thanx
    Sampath

  • List the files from server

    Hi Experts,
      I have a requirement in my application, that list out the files from the server in table and also delete the file. Pls specify the code.
    Regards,
    Kiruba.R

    Hi
    List all the files from server
    public void listServerFiles( )
        //@@begin listServerFiles()
        wdContext.nodeFiles().invalidate();
        IPrivateExperimentView.IFilesElement element;
        java.io.File file = new java.io.File( "D:\\Test");
        File list[] = file.listFiles();
        for( int i = 0; i < list.length; i++)
             element = wdContext.createFilesElement();
                  element.setFileName( list[ i].getName());
             wdContext.nodeFiles().addElement( element);
        //@@end
    Display the selected file
    public void onActiondownload(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
        //@@begin onActiondownload(ServerEvent)
        IWDResource resource;
        String name = wdContext.currentFilesElement().getFileName();
        String path = "D:\\Test\\" + name;
         InputStream stream;
         try {
              stream = new FileInputStream(path);
              resource = WDResourceFactory.createResource( stream, name,
                                  WDWebResourceType.UNKNOWN, true);
              stream.close();
              wdComponentAPI.getWindowManager()
                             .createNonModalExternalWindow( resource.getUrl( 0), name).show();
         } catch (FileNotFoundException e) {
              // TODO Auto-generated catch block
              e.printStackTrace();
         } catch (IOException e) {
              // TODO Auto-generated catch block
              e.printStackTrace();
    Delete the selected file
    public void onActiondeleteFile(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
        //@@begin onActiondeleteFile(ServerEvent)
        String path = "D:\\Test\\" + wdContext.currentFilesElement().getFileName();
        File file = new File( path);
        file.delete();
        listServerFiles();
        //@@end
    vinod

  • How to see the image from server

    hi,
    I have uploaded an image to server using following code. I want to see the image from server now. When i open this page then it show image. But when i want to see this image from server then it shows blank. Whats the problem of my code? Give me solution.
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
    <%@ page import="org.apache.commons.fileupload.*" %>
    <%@ page import ="org.apache.commons.fileupload.servlet.*" %>
    <%@ page import ="java.util.*" %>
    <%@ page import ="java.io.*" %>
    </head>
    <title>User Registration page</title>
    <body>
    <%
    boolean isMultipart = ServletFileUpload.isMultipartContent(request);
    FileItemFactory factory=new org.apache.commons.fileupload.disk.DiskFileItemFactory();
    ServletFileUpload upload =new ServletFileUpload(factory);
    List items = upload.parseRequest(request);
    Iterator iter = items.iterator();
         while (iter.hasNext()) {
         FileItem item = (FileItem) iter.next();
         if (!item.isFormField()) {
         String path=application.getRealPath("/");
         File tempfile=new File(item.getName());
         File uploadfile=new File(path,tempfile.getName());
         item.write(uploadfile);
         %>
         <br>
    <img src="<%=uploadfile%>" height="100" width="100">
    <br>
    <%=uploadfile%>
    <%
    item.delete();
    %>
    </body>
    </html>Is there anybody can help me.
    With regards
    Bina

    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
    <%@ page import="org.apache.commons.fileupload.*" %>
    <%@ page import ="org.apache.commons.fileupload.servlet.*" %>
    <%@ page import ="java.util.*" %>
    <%@ page import ="java.io.*" %>
    </head>
    <title>User Registration page</title>
    <body>
    <%
    String filename = "";
    boolean isMultipart = ServletFileUpload.isMultipartContent(request);
    FileItemFactory factory=new org.apache.commons.fileupload.disk.DiskFileItemFactory();
    ServletFileUpload upload =new ServletFileUpload(factory);
    List items = upload.parseRequest(request);
    Iterator iter = items.iterator();
         while (iter.hasNext()) {
         FileItem item = (FileItem) iter.next();
         if (!item.isFormField()) {
         String path=application.getRealPath("/");
         filename = item.getName();
                         File tempfile=new File(filename);
         File uploadfile=new File(path,tempfile.getName());
         item.write(uploadfile);
         %>
         <br>
    <img src="<%=path+filename%>" height="100" width="100">
    <br>
    <%=uploadfile%>
    <%
    item.delete();
    %>
    </body>
    </html>

  • How to run the client from server

    HI FRIENDS,
    I HAVE A SMALL PROBLEM WITH MY PROGRAM.I WANTED TO START THE CLIENT FROM SERVER I.E THE CLIENT SHOULD BE EXECUTED AS SOON AS THE SERVER STARTS EXECUTION.SOME OF THEM SAID THAT THIS CAN BE DONE BY USING 'EXEC' COMMAND.BUT I COULDNT.SO PLEASE ANYONE HELP ME IN DOING THIS.
    BYE
    KP

    HI FRIENDS,
    I HAVE A SMALL PROBLEM WITH MY
    MALL PROBLEM WITH MY PROGRAM.I WANTED TO START THE
    CLIENT FROM SERVER I.E THE CLIENT SHOULD BE EXECUTEDCan't be done, unless the server and the client are on the same machine, or you have some other COM object or service set up to allow someone to do this remotely

  • How to migrate the portal from server A to Server B

    Dear Expert,
    I have existing R3 name A and portal connecting. I have setup a new R3 name B on different server. Could you please provide me the steps on how can I migrate the portal connection from Server A to Server B. What are the steps involve .e.g. ITS and etc.
    Thank you
    KS

    Hi,
       The communication between portal server and R3 server happens via system only. If you don't want to use R3 system A hereafter, then look for R3 system alias created for 'A' in portal. You can delete that. Now for using new R3 system B in portal, create a new system for B in portal using System Administration. Decide which SSO you are going to use. If user is same in portal and r3, then logon tickets. Else user mapping method.
    Check these documents on how these can be done.
    https://www.sdn.sap.com/irj/sdn/wiki?path=/display/ep/howtoConnecttoSAPR3SystemthroughEnterprisePortal7.0Usingan+iView.
    Connecting To R/3 From Portal
    Configuring EP for connecting to SAP R/3
    Regards,
    Harini S
    Consider rewarding points for helpful answers

  • How to upload the data from legacy system database to SAP data base

    Hi.
    We are doing analysis of Legacy system and which needs to be converted to SAP system i.e. SAP implementation.
    I just want to know , how we migrate the existing whole data( from legacy system) into SAP system.
    and which method is the best method to use data migration from legacy to SAP system if data legacy data amount is huge.
    Please suggest me.
    Thanks.

    Hi
    We can either use the BDC or BAPI or LSMW  or Direct Input techiniques for the data transfers.
    The combination of both Session and Call transaction can be used to achieve this that includes the error handling also. This invloves the screen interaction.
    These days, BAPIs are used to overvome some upgrade problems. For easy upgradation, we cna go for BAPIs. Here ther is no screen intercation.
    LSMW mainly used for master data transfers using some standrad programs.
    As per your client or company desicions  we can choose any of them.
    Please refer to these links for more understanding -
    BDC Vs LSMW -
    BDC VS LSMW
    BDC Vs BAPI -
    BDC VS LSMW
    Thanks & Regards,
    Chandralekha.

  • How to delete the files from server through OAF page

    Hi All,
    I have a requirement in which i am creating files on server through my CO code.
    Now once the page is rendered, i want to delete the files from the server.
    Just wondering how can we achieve this.
    Kindly advice!
    Thanks,
    Sachin

    Hi Sachin
    all the methods in the processRequest() are called during loading of the page.
    all the methods in the processFormRequest() are called during any action events on the page.
    So Use the method in processFormRequest() : write a method in
    that on which action you want to delete the file.
    regards
    sridhar

  • How to call the RFC from XI system

    Dear Friends,
        My requirement is RFC to RFC scenario      i.e SAP to XI to Third party system.
    I have the BAPI_EUQI_CREATE rfc, this RFC is available in ECCsystem, that RFC I imported in XI system, so third party system how to call this RFC.
    please give me the suggestion it is very helpful.
    Regards,
    Shalini Shah

    Hi Shalini,
    You have create a RFC in the 3rd party system and import that RFC in XI System using 3rd party adapter.Do the necessary mapping and configure the sender RFC Adapter and at receiver side configure 3rd paty Adapter.
    The 3rd party adapters must be installed via Deploy Tool or JSPM. But u should have a sda file with the adpater content.
    see here for more details on JSPM
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/5006901f-925c-2910-5f98-9ae26cc07eca
    For more info:
    If you still want to do it,
    1. Import the RFCs of sender and of receiver.
    2. Do the necessary mapping.
    3. Configure sender and receiver RFC adapters.
    Before that check if you have RFC destination for the RFC adapter. If not You should establish it. To establish an RFC destination for the RFC adapter.
    1. Call the transaction Display and Maintain RFC Destinations (SM59).
    2. Select an existing RFC destination of type ABAP Connections (for example, ABAP_Old) by double-clicking it.
    3. Choose Destination ® Copy and copy the RFC destination using a new name (for example, ABAP_New).
    4. Save the new RFC destination (ABAP_New) and delete the old RFC destination (ABAP_Old).
    5. Create a new RFC destination (for example, RFC_Adapter) of type T (TCP/IP connection) as the RFC destination for the RFC adapter.
    6. Select the registration type Registered Server Program and in the Program ID field enter the corresponding program ID from the configuration of the sender RFC adapter.
    7. In the Gateway host and Gateway service fields, enter the gateway host and gateway service from the configuration of the sender RFC adapter.
    8. If the sender system is a Unicode system, define the RFC destination as Unicode.
    9. Using the name of the old ABAP connection (ABAP_Old), create a new RFC destination of type L (logical destination with reference entry).
    10. In the Reference Entry field enter the RFC destination (RFC_Adapter) for the RFC adapter.
    For more details take a look at this link. http://help.sap.com/saphelp_nw70/helpdata/en/25/76cd3bae738826e10000000a11402f/content.htm
    Dont forget to Reward points if this helps
    Regards
    Pragathi.
    Edited by: Pragathi on May 24, 2008 7:21 AM

  • How to move the changes from one system to other without using CMS

    Hi
    In our project they are migrating NWDI 6.40 to NWDI 7.0.
    During migration CMS won't be available.
    Could you plesae tell what are the different options are there to move the WebDynpro changes from (NWDS) Development to Quality system and then production system without using CMS server?
    If i will create a development package and import this packgae in Quality package will my new changes also be available in Quality server?
    Thanks & Regards
    Susmita

    Hi Susmita
    I wasn't completely sure, but from your description of your problem, it seemed like you would have access to your DTR during your upgrade. The following solution assumes as much. If this is not the case, you'll need to do things slightly differently, but the solution will still be possible.
    Depending on the scope and size of your changes, it may be practical for your developers to deploy directly from their NetWeaver Developer Studio (or for a designated administrator to install the NWDS and do the same). To do so, from the Development Configurations perspective, create a new NWDS project for each of the DCs you want to deploy. Then right-click the project and choose from one of the deployment options. (Deploy new archive and run will allow you to see if your deployment has taken effect.) When deploying, the target server is the one set up as your J2EE engine in the NWDS properties - you'll consequently have to modify this when the target server for your deployment changes (from QA to production, or vice versa).
    Note that this is only applicable in certain situations, and only as a short term stopgap measure. This sort of practice - developers or administrators deploying haphazardly to servers other than those intended for development - is precisely what the NWDI is designed to prevent (and is one of very few things it's fairly good at doing). For instance, if your QA and production systems are attached as TEST and PROD runtimes systems respectively in your NWDI, a full assembly and subsequent full deployment would usually occur to these servers when deploying with the NWDI. This is a much stronger guarantee of consistency than the build that will be performed within your local NWDS to deploy your changes. (Conversely, the rigidity of the assembly is perhaps the NWDI's greatest design flaw.)
    (Also, Snehal: thanks for the information on the sapmake_util blog. It's not something I've encountered before and looks very useful.)
    James

  • How can download the roles from one system and upload them into another  ??

    Do anyone have the solution ..... ......it  very  important.

    Hi,
    Visit [Role Maintenance Functions|http://help.sap.com/saphelp_nw04/helpdata/en/e4/15e48efd6c11d296430000e82de14a/content.htm] in section Download/Upload.
    To avoid inconsistencies, all roles from which a role is derived are also downloaded. When you download composite roles, all the roles which they contain are also downloaded.
    When you upload a role, all role data, including authorization data is uploaded from a file into the SAP system. The user assignments for the role and the generated profiles for the role are exceptions in this case. You must therefore regenerate the authorization profiles after the upload.
    Mass Download:
    Save several roles on the PC.
    You can choose on the selection screen whether you:
         Also want to transport the single roles contained in the selected composite roles (Customizing switch ADD_COMPOSITE_ROLES in table SSM_CUST)
         Also want to transport the generated profiles for all single roles (PROFILE_TRANSPORT in table PRGN_CUST)
    You can define the default setting for both options using the value in the Customizing switch. If you explicitly set a switch to NO, the option in question on the selection screen is not active. Otherwise, it is active.
    Regards,
    Srilatha.

  • How to bring the data from application server to presentation server

    hi,
    i have one problem,i have written the program which will open the files in the application server when we run the program in the background(sm37),the same data from application server i want to bring into presentation server in the format of (.csv),how to bring the data from application to presentation server can any body help me on this  topic.folowing is the code .
    *& Report  ZPFA_HIER_LOAD
    REPORT  ZFPA_HIER_LOAD.
    *---- Declaration of Oracle connectioN
    DATA con_name LIKE dbcon-con_name VALUE 'COMSHARE'.
    DATA: MFL1(9),MFL2(5),MFL3(9),MFL4(2),MFL5(8) TYPE c.
    DATA : mfilename type string.
    data: begin of matab1 occurs 0,
          MFL1(9) TYPE C,
          MFL2(5) TYPE C,
          MFL3(9) TYPE C,
          MFL4(2) TYPE C,
          MFL5(8) TYPE C  ,
         end of matab1 .
    data: setid(8) type c.
    data: begin of source occurs 0,
          setid(8) type c,
          end of source.
    *PARAMETERS : p_pfile LIKE filename-FILEEXTERN.
    *PARAMETERS : m_bsenty(8). " type c obligatory.
    *mfilename = P_PFILE.
    EXEC SQL.
      SET CONNECTION :con_name
    ENDEXEC.
    EXEC SQL.
      CONNECT TO :con_name
    ENDEXEC.
    EXEC SQL PERFORMING get_source.
      SELECT set_id FROM UNIT_SET INTO
      :setid
      ORDER BY SET_ID
    ENDEXEC.
    start-of-selection.
    LOOP AT SOURCE.
      REFRESH matab1. CLEAR matab1.
      EXEC SQL PERFORMING evaluate.
    SELECT TO_CHAR(MEM_ID),TRIM(TO_CHAR(MEM_PID)) FROM UNIT_TREE INTO :MFL1,
    :MFL5
    where set_id = :SOURCE-SETID ORDER BY MEM_ID
      ENDEXEC.
      if SOURCE-SETID = '80000000'.
       mfilename = '/tmp/aesorg'.
      elseif SOURCE-SETID = '80000006'.
       mfilename = '/tmp/Consolidation_Manager'.
      elseif SOURCE-SETID = '80000010'.
       mfilename = '/tmp/10org'.
      elseif SOURCE-SETID = '80000012'.
       mfilename = '/tmp/20org'.
      elseif SOURCE-SETID = '80000018'.
       mfilename = '/tmp/30org'.
      elseif SOURCE-SETID = '80000025'.
       mfilename = '/tmp/40org'.
      Endif.
      mfilename = '/usr/test.dat'.
    ************************This was i tried***********************
      open dataset mfilename for output in text mode encoding default." IN
    *TEXT MODE ENCODING DEFAULT.
    if sy-subrc <> 0.
    exit.
    endif.
    close dataset mfilename.
    CALL FUNCTION 'GUI_DOWNLOAD'
       EXPORTING
         FILENAME         = MFILENAME
         FILETYPE         = 'ASC'
       TABLES
         data_tab         = matab1
       EXCEPTIONS
         file_write_error = 1
         invalid_type     = 2
         no_authority     = 3
         unknown_error    = 4
         OTHERS           = 10.
    loop at matab1 .
    transfer matab1 to mfilename.
    endloop.
      clear matab1.
    ENDLOOP.
    loop at matab1 .
    transfer matab1 to mfilename.
    endloop.
    close dataset mfilename.
         MFL5 = '0'.
       CLEAR MFL5.
    FORM evaluate.
      if MFL5 = -1.
        MFL5 = ''.
      ENDIF.
      concatenate MFL1 ','   into MFL1.
      concatenate MFL1 ','   into MFL3.
      matab1-MFL1 = MFL1.
      matab1-MFL2 = 'ZBUE,'.
      matab1-MFL3 = MFL3.
      matab1-MFL4 = ' ,'.
      matab1-MFL5 = MFL5.
      append matab1 .
      CLEAR MFL1.
      CLEAR MFL2.
      CLEAR MFL3.
      CLEAR MFL4.
      CLEAR MFL5.
    ENDFORM.
                     "evaluate
    *&      Form  GET_SOURCE
          text
    FORM GET_SOURCE.
      source-setid = setid.
      append source.
      clear source.
    ENDFORM.                    "GET_SOURCE

    Hi Rammohan,
    You cannot use OPEN DATASET to transfer data from application server to presentation server.
    You can do the following :
    <b>Do 1st point in BACKGROUND</b>
    1. Read the data file from application server into an internal table using OPEN DATASET
    <b>Do 2nd point in Foreground</b>
    2. Once you get the data into an internal table, then use FM GUI_DOWNLOAD to download it on presentation server
    You cannot use the above 2 point together in Background because its not possible. Hence you need program it partially in background and partially in foreground.
    Best regards,
    Prashant

  • How to delete the apps from your iPhone's purchased list in ios 7

    How to delete the apps from your iPhone's purchased list in ios 7

    You would need to set up the Hotmail account as a IMAP instead of a POP3 account.

  • How to select the vendor from the source list in the PO(me21n) screen ??

    Hi
    How to select the vendor from the source list in the PO(me21n) screen.
    Is there any Sources of Supply tab in the PO just like we have in the PR.
    I don't want a PO raised from a PR which has got the Vendor assigned to it already.
    Or the SAP doesnot provide the option of Source list/Assign source/Sources of Supply .....in the PO.
    Kindly reply

    There is not any facility available for Source Determination in PO. Only you can select the line item and click Menu Environment > Source List and view the list of sources available for the material but you can not chooss and assign. If you wan to assign the vendor then change the vendor already entered in PO and put the desired vendor.

  • How to take the data from excel list to sap r/3(with time interval)

    hi experts,
       how to transfer the data from a third party system(if it is in format of excel) to sap r/3.with that in a particular time interval,it will delete the data from excel sheet.

    Hi
    use the Fm
    'ALSM_EXCEL_TO_INTERNAL_TABLE'
           EXPORTING
                filename                = p_path
                i_begin_col             = '1'
                i_begin_row             = '2'
                i_end_col               = '2'
                i_end_row               = '500'
          giving the starting row and column and passing the ending row and column name
    Reward points if useful........
    Regards,
    Nitin Sachdeva

Maybe you are looking for

  • HP LASERJET CP1525nw print error when printing online Gmail emails with Google Chrome

    HP LASERJET CP1525nw print error when printing online Gmail emails with Google Chrome. Extra large font sizes and weird formatting issues only when printing emails from Gmail within Chrome. No problems when printing the same email from Gmail+Internet

  • Instead of trigger with ADO - once again

    since everyone seems to ignore my last 2 posts, i thoght of tring one more time. before i give up the use of instead of updates and redesign the system, which really sux. i dont understand why i can get a response from the oracle team.. do i have to

  • Help needed to create a CSS 'style-switcher' button.

    Hi, I need some help please in creating alternate style sheets for each page on a site I'm creating to enable users to change text size (i.e. small, normal and large options - sometimes, symbolized as a letter 'A' in varying sizes). The site has been

  • Store procedure in oracle 9i

    hi.. can any body guide me about store procedure in oracle 9i. if possible please tell me the scripts also. thanks in advance.

  • Link to ping iTunes now redirects to the iTunes store

    iTunes provided a link when it accepted my podcast feed in order to ping it when I've added a new episode. I've been using it for the last 35 episodes with little trouble, usually a few hours to a day after I ping it my episode will show up in iTunes