I'm trying to send images over a HTTP connection from MIDP 2.0. I'm receiving the images on a Tomcat 5.0 server. I have successfully sent an image that is 2016 bytes in size, but as soon as the image is larger than that the servlet refuses to accept it. Can anyone help me. It's the last thing I have to do for this current project. I've studied this post with no success https://coderanch.com/t/227896/JME/Mobile/sending-image-server-HTTP-connection
Client Side-
DataOutputStream os = new DataOutputStream(hc.openOutputStream());
os.write(sendData, 0, sendData.length);
os.close();
Server Side-
int len = req.getContentLength();
byte[] b = new byte[len];
ServletInputStream in = req.getInputStream();
DataInputStream din = new DataInputStream(in);
din.read(b, 0, len);
File f = new File("c:/test.png");
FileImageOutputStream imout = new FileImageOutputStream(f);
imout.write(b,0,len);
imout.close();
Client Side-
DataOutputStream os = new DataOutputStream(hc.openOutputStream());
os.write(sendData, 0, sendData.length);
os.close();
Server Side-
int len = req.getContentLength();
byte[] b = new byte[len];
ServletInputStream in = req.getInputStream();
DataInputStream din = new DataInputStream(in);
din.read(b, 0, len);
File f = new File("c:/test.png");
FileImageOutputStream imout = new FileImageOutputStream(f);
imout.write(b,0,len);
imout.close();