Forums Register Login

Sending images over HTTP

+Pie Number of slices to send: Send
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();
+Pie Number of slices to send: Send
Hi Jari,

I'm sorry i don't have a solution to ur problem, but i have a doubt.
were u able to display images of size more than 10 KB.
i am using a resize function which does not allow me to do so.
+Pie Number of slices to send: Send
Hi Joel,

I am displaying an image that is 20k in size no problem currently on emulators. Waiting for the Nokia 6630 before I test the application on a real phone. If anyone can help me out with the http transfer that would be appreciated. Thanks.
+Pie Number of slices to send: Send
Revisited Michael Yuan's code and got image transfer working great with Tomcat5. If you read this Michael, thanks man, your a legend
+Pie Number of slices to send: Send
That is cool. Thanks for the complement. I am glad that my writing is helpful!
+Pie Number of slices to send: Send
hi there i might be a bit of subject but i need help! i bought a nokia 6630 an i have got a virus on it called [yuan] does anybody no how to remove it??? if u do plz e-mail me at marcus_russell@hotmail.co.uk thatnxs a lot ppl!
The only thing that kept the leeches off of me was this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 1393 times.
Similar Threads
Help - Post Image - getting UPLOAD_ERR_PARTIAL
Bluetooth connection
problem with DataInputStream.readInt() method
send image in post method from J2ME to Servlet
network transfer of image
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 18:14:49.