Server Client transfer file

Hi!!
i'm starting to use socket and i have a problem: i have a client and a server and i want that the client sends a file (file isn't only a text file) to the server so that the server can open it. Or that the server sends the file to the client (it's the same non problem).
Please is there someone that can write the code for helping me. I don't know how can resolve this problem of file.
Thanks.......

I have a client that sends a file to a server using
pakets of a maximum of 50 bytes. When the server
receives a packet it "acknowledges" it (like TCP
would do) sending a packet back to the client
indicating if the packet has (or has not) been
received in order with errors...My first question is 'why'? Why use UDP? Why use such a tiny packet size?Why re-invent TCP?
This will never be a commercial project so I would just stop right now.

Similar Messages

  • Encrypted packets between server - client (swf file)

    hello guys,
    can some1 know how can i decrypt some packets which are sended between server - client (swf file) ?
    ty

    You shouldn't need to sync u/gid's. 
    The first thing that comes to my mind here is simple filesystem perms.  To test I would make the shared dir world/group readable/writeable - IE chmod 777 /my/shared/folder. then try connecting from the remote client.  Remember, there are two sets of access permissions...Share level and filesystem level.
    You can do user/group mapping if you're in a Windows AD or domain environment, but with stand-alone Samba servers this is not necessary.
    I would also check the samba check list at the following link for a decent, simple set of items to look at for basic troubleshooting...
    http://us3.samba.org/samba/docs/man/Sam … nosis.html

  • J2EE, possible to serve clients jsp files that are outside the war file?

    Hi, I was wondering with a J2EE webserver if it was possible to serve clients webpages from jsp files that were outside the client.
    For example say you got your war file in the auto deploy directory on the server and also on the server you got a directory full of jsp files that could be accessed by the webserver just like normal jsp files inside the war file?
    ...I want to do this because I want to be able to add jsp files without rebuilding the war file.
    ....Or is it possible to make the webserver rebuild itself, eg to add or remove files?
    Thanks

    If you are using a S1WS6.1, please try to find a line with WEBAPP in server.xml.
    You should find a line like this.
    <WEBAPP uri="/simple" path="/opt/SUNWwbsvr/https-test/webapps/https-test/simple" enabled="true"/>
    The path parameter shows the directory where the S1WS refers to when the webapplication is executed.
    You can put a jsp into the directory and modify it accordingly.
    Please refer to the following docs. They might help.
    http://docs.sun.com/source/817-6251/pwadeply.html#wp25317
    http://docs.sun.com/source/817-6251/pwadeply.html#wp25890
    thanks,
    -Yuji

  • Transfer file from client to server using http

    HI friends,
    I want to transfer files from client to server...I tried that with the help of socket and rmi..........
    But Http is only the best mechanism for my application..........
    Without using servlets, how to transfer files with the help of http.....
    Any help would be appreciated.......

    Google is your friend, and appearently www.jguru.com also:
    http://www.jguru.com/faq/view.jsp?EID=160

  • How to transfer file from one client to another client?

    hello,
    i have some questions and hope you all can help me..thanks a lot first..
    Here are the questions:
    i) How can i send a file from one client to another client using RMI?
    ii) Does the client(sender) need to send the file to server, then server save it and then send it to another client(receiver)?
    iii) If using RMI, a client can receive two files from same client(sender) or different client(sender) at a same time? how to do it? when both of the files come in from same port, how to differenciate them?
    iv) For your information, i am doing the File Transfer Server-client application which sender can send any file to other client. Can you give me any ideas? thanks..
    Last, thanks again..

    Your questions reflect some ambiguity in terms.
    "Client" and "server" are commonly used in two different senses:
    1. Technical sense: A client process makes requests, and a server process fulfills the request (provides a service).
    2. IT sense: A client computer (process) makes requests of a server (computer) process, and the server (computer) processes the request.
    In the first case, any computer might be a client, or a server, or both, depending on the processes being executed. In the second case, the computers are assigned some role.
    So: If you wanted to, you could implement client/server processes communicating between two peer computers, using RMI.
    This may not be what you wanted; if you really want to distinguish client and server computers, then the answer is that yes, you will probably put files into intermediate storage on the server computer.
    Finally, you probably do not have to worry about port conflicts if you use RMI; while the initial client server contact is established through a registry operating on a standard port, the actual RMI communications is established using random ports, one for each link.

  • Copying client machine files into the Server BY Using APPLET

    Hi there,
    I created an applet which is DRAG and DROP enabled. In this applet content page i am dropping some file and trying to copy the same files in to the server. But when i am trying to save the files my code is saving the files in clients machine.
    I thought we are embedding the applet in a browser and the applet is running in clients machine, so for the applet SERVER is the local machine and if we create any files then they will be created in SERVER machine.
    But here the files are going to be saved in clients machine.
    I SIGNED THE APPLET TO ACCESS THE CLIENT MACHINE FILES TO DRAG AND DROP INTO MY APPLET. THAT IS NOT A PROBLEM , BUT COPYING THE FILES FROM CLIENT MACHINE TO SERVER HAS BECOME A BIG PROBLEM
    please any body can help in this regards?
    THANKS IN ADVANCE.
    batta

    I cannot see how you will copy files From the Applet to the Server.
    The only method I know to transfer data from a Java-Applet-Client to a Server and back is with the named method "HTTP-Tunneling".
    This means your, your applet made a connection e.q with a Java-Servlet wich resides on a Web-Server.
    This Servlet than can write to the Server-Filesystem and respond to the Applet.
    May be you can reach a Server with PHP, but I have not yet experience with this (I did not found anything about Servlet-Response to the Applet).
    Regards Dieter

  • Using WEBUTIL to transfer files to server

    We need to transfer files from Forms client to database server filesystem.
    It seems, WEBUTIL_FILE_TRANSFER doesn’t provide this functionality.
    We modified supplied webutil_db package body, so if the blobtable parameter is 'FILE' – closeblob procedure will use UTL_FILE to write OS file instead of updating blob in table.
    Now we can call
    webutil_file_transfer.client_to_db (clientfile => myclientfilename,
    tablename => 'FILE',
    columnname => myserverfilename,
    whereclause => myserverdir
    This solution is working fine, but, of course, our concern is compliance of our custom changes with future releases of WEBUTIL.
    Any plans to add something like Client_To_Server procedures to webutil?

    Just a thought..
    1) make table that accepts your blob via client_to_db.
    2) write a after insert trigger that copies file to an Oracle Directory on db file system.
    You could also maybe use this PLSQL ftp package.. I havent used it.. Users talk about it frequently on other forums here, namely the sql and plsql forum.
    http://www.chrispoole.co.uk/apps/xutlftp.htm
    Notice the "unloading blobs to database filesystem" line below.
    With XUTL_FTP the transferring of the file IS the data loading process.
    The file is NOT copied to disk, it's simply 'poured' straight into whatever table you like!
    If this wasn't enough, it also has the other following uses:
    unloading BLOBS to the database server file system (as UTL_FILE does not have a working binary implementation until 10g)
    arbitrary unloading of data to remote servers
    obtaining a file listing for a directory on the database server file system Message was edited by:
    Mark Reichman
    Message was edited by:
    Mark Reichman

  • When client send file  connection with server close

    please help me.
    i want to transfer a file via server - client model.
    Client send the file, server receive it.
    Then when i send a msg from server to client i have this error:
    java.net.SocketException: socket closed
    why the socket closed?

    client waiting for response. i don't know what to do.
    the client code is:
    import java.net.*;
    import java.io.*;                              
    class Client{               
         Socket clientSocket;               
           byte[] byteArray;                    
           BufferedInputStream bis;          
            BufferedOutputStream bos;          
           int in;                                   
           BufferedReader inm = null;
            PrintWriter outm = null;
           public Client(){
             try{
                    clientSocket = new Socket("localhost", 9632);
                   System.out.println("i am client & connect");
                   inm = new BufferedReader(new InputStreamReader(clientSocket.getInputStream()));
                   outm = new PrintWriter(clientSocket.getOutputStream(), true);
                   System.out.println("------1--------" +clientSocket.isClosed());
                      outm.println("msg 1: hi");
                      System.out.println("from server__ " +inm.readLine());
                      outm.println("msg 2: now i will send you a file");
                      System.out.println("from server__ " +inm.readLine());
                      sendFile();
                     System.out.println("-------2-------" +clientSocket.isClosed());
                      System.out.println("from server__ " +inm.readLine());
             catch(IOException e){
                    e.printStackTrace();
           public void sendFile(){
                try{
                     bis = new BufferedInputStream(new FileInputStream("encryptAtmMsg.txt"));
                    bos = new BufferedOutputStream(clientSocket.getOutputStream());
                    byteArray = new byte[8192];
                    while ((in = bis.read(byteArray)) != -1){
                       bos.write(byteArray,0,in);
                        bis.close();
                      bos.close();
               catch(IOException e){
                    e.printStackTrace();
           public static void main(String[] args){
             new Client();
    }And server code is:
    import java.net.*;
    import java.io.*;
    class Server{
         BufferedInputStream bis;
           BufferedOutputStream bos;
           byte[] data;
           Socket socket;
           ServerSocket serverSocket;
           int in;
            BufferedReader inm = null;
            PrintWriter outm = null;
           public Server(){
             try{
                    serverSocket = new ServerSocket(9632);
                    System.out.println("i am server & listening...");
                   socket = serverSocket.accept();
                     System.out.println("a client connect");
                   System.out.println("------1--------" +socket.isClosed());
                    inm = new BufferedReader(new InputStreamReader(socket.getInputStream()));
                    outm = new PrintWriter(socket.getOutputStream(), true);
                   System.out.println("from client: " +inm.readLine());
                     outm.println("ack 1: hi....");
                     System.out.println("from client: " +inm.readLine());
                     outm.println("ack 2: ok....");
                    receiveFile();
                      System.out.println("------2--------" +socket.isClosed());
                   outm.println("ack 3: take the file");
             catch (IOException e){
                  e.printStackTrace();
         public void receiveFile(){
              try{
                  byte[] receivedData = new byte[8192];
                 bis = new BufferedInputStream(socket.getInputStream());
                   bos = new BufferedOutputStream(new FileOutputStream("encryptAtmMsg22.txt"));
                 while ((in = bis.read(receivedData)) != -1){
                       bos.write(receivedData,0,in);
                 bos.close();
             catch (IOException e){
                  e.printStackTrace();
         public static void main(String[] args){
             new Server();
    }any idea pls

  • Transfer files from SAP R/3(unix server) to windows

    Hi TechGurus,
    We have a requirement where in , we are extracting data from SAP table into a text file using OPEN DATASET in TEXT MODE.
    Then using a third party tool (Connect-direct), we are transferring text files to windows server using unix script, in binary mode.
    The problem is that that the data is being transferred in blocks,each time beginning transfer from a new line.That is, after say transferring 25KB data it transfers next 25KB data from a new line. What happens as a result is that records
    after particular amount of data is broken and remaining data transfer begins from new line.
    The file size is around 25 MB.There is no such problem while transferring file of size 10 KB.
    We are uploading the data from text file on windows server into MSAccess.
    And error occurs during this process.
    Assured points for helpful answers
    Thanks in advance!!

    Hi,
    If you want to transfer file between different SAP servers then you can use the function module EPS_FTP_PUT. You need to have a RFC destination (with sufficient authorizations for the RFC user). The meaning of the importing parameters of the function module are quite obvious. Of course, SAP offers us more than this function module:
    - EPS_FTP_GET
    - EPS_FTP_MPUT
    - EPS_FTP_MGET
    Kishi.

  • How to transfer file from application server to presentation server in background?

    Hi Experts,
    How to transfer file from application server to presentation server in background?
    Thanks in advance
    Namita

    Thanks Raman and Challa,
    We want to move file from application server to Shared folder, not on local machine. We checked FM which you guys have provided but those are not able to read file from application server.
    We need this program to run in background so that we can use this in daily process chain.
    Appreciate your inputs on this.
    Thanks,
    Namita

  • Changes in server side java file not reflecting in Client side java code?

    Hi friends,
    iam using eclipse IDE, JBoss server, SWING GUI and Oracle DB
    ( looks like : SWINGGUI (Client) <--> EJB's (serverside) <---oracle )
    my problem is , when i make change in server side bean file, that changes are not reflecting in GUI programs.
    (for ex: iam adding settr and getter for a field and using that in GUI program. but its not identifying that setter or getter).
    please tell me what should i do for every change done to server side program, that should reflect / available to GUI?

    my problem is , when i make change in server side bean file, that changes are not reflecting in GUI programs.
    (for ex: iam adding settr and getter for a field and using that in GUI program. but its not identifying that setter or getter).what do you mean it's not "identifying" the methods?
    you have to call those methods you know
    are you getting NoSuchMethodError?
    please tell me what should i do for every change done to server side program, that should reflect / available to GUI?you haven't posted any code or error messages that might help us debug

  • How can I Create a Client Configuration File for RemoteApp and Desktop Connection with Server 2012?

    I have a working RDS RemoteApp site and looking to test out the feature in Windows 7 Control Panel\All Control Panel Items\RemoteApp and Desktop Connections
    I came across this link: Create a Client Configuration File for RemoteApp and Desktop Connection and I believe this is what I need to do first, but these instructions are for
    Server 2008, and I'm running 2012.
    Any suggestions or tips on how I can begin testing this with Server 2012?

    Hi,
    You can manually enter the path to the 2012 feed and it will connect and download the RemoteApps and Desktop connections.
    If you need a sample .wcx file I have posted one here a couple of times.  If you want I will look for it and post a link.
    -TP
    I tried adding my URL's below, these are sample links that work for me right now for when I log into the web page, but neither of these work.  And I'm not sure what I would need to do with or how to create a .wcx file.
    When I type in my URL of: https://connect.mydomain.org/RDWeb, I get redirected to: 
    https://connect.mydomain.org/RDWeb/Pages/en-US/login.aspx?ReturnUrl=/RDWeb/Pages/en-US/Default.aspx

  • To create a new file in application server and transfer data to ti

    i am doing the following where i have to create a new file in application server and transfer data to tht file from an internal table.but its saying file cant be opened.the path i am giving to parameter p_prefil is /tmp/prachi.txt.
    wats the prob..can anyone help.
    DATA:L_WA_FINAL TYPE TY_FINAL,
         l_wa_string type string.
    OPEN DATASET P_PREFIL FOR OUTPUT IN text mode encoding default.
    if sy-subrc <> 0.
    write: ' file cannot be opened'.
    stop.
    endif.
    LOOP AT P_I_FINAL INTO L_WA_FINAL.
    move l_wa_final to l_wa_string.
    TRANSFER l_wa_string TO P_PREFIL.
    if sy-subrc <> 0.
    write: 'file can not be written'.
    stop.
    endif.
    clear l_wa_final.
    ENDLOOP.
    CLOSE DATASET P_PREFIL.
    if sy-subrc <> 0.
    write: ' file cannot be closed'.
    stop.
    endif.

    DATA:L_WA_FINAL TYPE TY_FINAL,
    l_wa_string type string.
    OPEN DATASET P_PREFIL FOR OUTPUT IN text mode encoding default.
    if sy-subrc ne 0.
    write: ' file cannot be opened'.
    stop.
    endif.
    LOOP AT P_I_FINAL INTO L_WA_FINAL.
    move l_wa_final to l_wa_string.
    TRANSFER l_wa_string TO P_PREFIL.
    write: 'file can not be written'.
    clear l_wa_final.
    ENDLOOP.
    CLOSE DATASET P_PREFIL.
    if sy-subrc ne  0.
    write: ' file cannot be closed'.
    stop.
    endif.

  • How do I setup permission to transfer files to the MacMini Server. I thought I had it setup to do such but apparently not as I get an error message?

    How do I setup permission to transfer files to the MacMini Server. I thought I had it setup to do such but apparently not as I get an error message that I don't have permission?

    Both the Mac and Windows units we are usinghave connectivity to the MacMiniServer (on the same network) to open and edit files but cannot transfer new files to the MacMini. FileSharing is on. I went to File Sharing on the MacMini and added the appropriate users and checked FileSharing. Is there something else I needed to do?

  • (261705413) Q RPCC-7 Does the client.jar file tie you Weblogic Server?

    Q<RPCC-7> BEA is providing client-side helpers in the client.jar file, including
    parsing and SOAP facilities, etc. But, are we saying that there is nothing
    in there that ties the client to the server-side WLS implemenation? It seems
    that putting the interface of the underlying implementation EJB SLS bean is a
    coupling...??? It also seems that by coupling the client to WebLogic classes
    (weblogic.soap.WebServiceProxy|SoapMethod) we are coupling it to WLS.
    A<RPCC-7>: I understand your concerns, but you are not tied to WLS that tightly.
    Certainly, the static client code utilizes the EJB interface that underlies the
    web service but it is possible to invoke the web service dynamically. The use
    of weblogic library classes to invoke the web service just indicates the use of
    weblogic's client API. This client API can also be used to invoked webservices
    hosted on other application server or frameworks. Additionally, other client APIs
    can be used to invoke this web service, for instance the VB client example that
    ended Thursday's presentation. Lastly, the remote interface in the client.jar
    file could actually just be a java presentation generated from a WSDL file that
    represents a C# web service (this is actually only possible in WLS7.0 and not
    6.1 but the point is you do not actually know the inderlying framework or implementation
    andnor should you care).
    Adam

    check the server log;
    /app/oracle/product/fwm11g/user_projects/domains/fwm_domain/servers/AdminServer/logs/AdminServer.log
    you can launch the console and see if it is running; http://<server>:<port>/console

Maybe you are looking for

  • Losing network connection (NOT WIRELESS) every 3 months

    About every three months I get a 169 IP which I am told is a computer assigned "bad" ie non functional IP address. The first timewas last november and the cable company spent 2 hours here and said cable was ok- while talking to apple- they never solv

  • Macbook Pro won't pair with my existing Bluetooth Mouse.

    I used a bluetooth mouse with my macbook pro and had no problems. Since the lastest Mountain Lion Updapte (10.8.2), the laptop finds the mouse but the pairing with the device doesn't work. I've changed the batteries and restarted the laptop several t

  • URGENT HELP ON HASHMAP OBJECTOUTPUTSTREAM

    hi java gurus , i am developing a appln which will constantly write a hashmap to a file through objectoutput stream through serialisation.so by this approach when i need to add a new record i need to read the whole file store it in a hashmap and then

  • FAGLFLEXA table export and import.

    Hello Gurus, I want to export FAGLFLEXA table from quality 200 client & import into developement 110 client. Want to know different ways to copy it between two different sap system. If anybody knows, help me for it. Thanks & Warm Regards, Prashant

  • ServletContainerAdapter manager not initialized correctly wls11g

    Hi, I am using the weblogic 11g(10.3.1 version) to connect with LDAP server. I created the new authenticatior provider.in provider specific tab of this Authenticator Provider, i gave the settings for LDap server. then,i restarted the weblogic server.