How to transfer a JPEG file from client to server using sockets JAVA
I searched on Google about this topic few days back. But I could not found a complete solution.Finally I came up with a solution. These methods from my client and server class shows it. Client Part public void uploadFile(File f){ try { socket=new Socket("127.0.0.1", 4000); BufferedInputStream in=new BufferedInputStream(new FileInputStream(f)); byte[] buffer = new byte[(int)f.length()]; in.read(buffer, 0, buffer.length); OutputStream os = socket.getOutputStream(); ...