I have a java servlet which accepts an image a user uploads to my web app.
I have another server (running php) which will host all the images. How can I get an image from my jsp server to my php server? The flow would be something like:
public class ServletImgUpload extends HttpServlet
{
public void doPost(HttpServletRequest req, HttpServletResponse resp)
throws ServletException, IOException
{
// get image user submitted
// try sending it to my php server now
// return success or failure message back to user
}
}
Thanks
A few solutions off the top of my head...
Also, remember to consider how often images are going to be pushed to your servlet. You don't want to try holding 100s of images and their transfers' network sockets in memory - save the images to the disk in this instance.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With