Hi, I'm making a program that gets a file and sends it via a socket. The file to get will be specified by a String that the user enters. Problem is, I have no idea how you retrieve files.
I've tried "File file = new File(input)" but that just creates a file (I think), doesn't actually retrieve an already existing one...
Also, how would you then send said file via TCP? I cant do writeBytes(file ) on the socket's outputstream, since that method only takes Strings.
Help? Thanks, and much appreciated.
I've tried "File file = new File(input)" but that just creates a file (I think), doesn't actually retrieve an already existing one...
Also, how would you then send said file via TCP? I cant do writeBytes(file ) on the socket's outputstream, since that method only takes Strings.
Help? Thanks, and much appreciated.
Comment