I have a Java client/server desktop application, where the communication between client and server is based on Sockets, and the messages exchanged between client and server are serialized objects (message objects, that incapsulate requests and responses).
Now I need to make the client able to upload a file from the local computer to the server, but I can’t send the File through the buffer, since the Buffer is already used for exchanging the message objects.
Should i open another stream to send the file, or is there any better way to upload a file for my situation?
I need to make the client able to upload a file from the local computer to the server– Open a
Solely Dedicated Connectionto the Server for File uploading.– Use
File Transfer Protocolto ease your work, and moreover its quite easy and reliable to use theApache's common libfor File uploading and downloading….See this link:
http://commons.apache.org/net/