Hello,
To send files, it's almost like, send the file byte by byte (or byte or I do not know actually). Here is a track (which I use to send a file from a client to a server). From there, the server side (which receives) should not be complicated to guess. Just try the following code
Code:
BufferedInputStream bis = new BufferedInputStream(new FileInputStream(file));
OutputStream ops = new BufferedInputStream(socket.getOutputStream());
byte[] bytes = new byte[1024];
int num;
while ((num = bis.read(bytes, 0, 1024)) != -1) {
ops.write(bytes, 0, Num);
}
Bookmarks