I wrote a code few days ago that enables the client (on Java) to send an image to the server(on Python) and save it as a blob format in mysql. How can I do this in reverse? How can I send a picture from the server on python to the client on java ( with socket , for example ?)
1 Answer
You cannot send picture from the server. You can write a client which will retrieve picture from the server. SimpleHTTPserver in Python can answer the url with image. Reading Image with Java is even more easier. Use url what python provides and save it with Java.
5 Comments
TM.
Why not? I don't think he's saying it has to be over HTTP.
TM.
Servers send things to clients all the time, without having to receive a request first.
Alex
That would be something new for me. The client process always initiates a connection to the server, while the server process always waits for requests from any client.
TM.
You're getting caught up on the nomenclature. The point is his Python program can open a connection to the Java program. The fact that one is a server for some things doesn't mean it can't be a client for others.
Michael
I don't understand, what is wrong with client sending "show picture" and the server's response is the picture ? Why can't this work ?