10-06-2011 07:39 PM - last edited on 10-06-2011 07:41 PM
Hello everyone:
I'm having troubles with my app. I developed a web service to receive the info from a form in BB. Everything works ok. But now, I need to extend my web service to receive images from the device. I tried to extract the file bytes
FileConnection file = (FileConnection) Connector.open(path_to_file);
byte[] photoRaw = new byte[(int) file.fileSize()];
try {
InputStream input = file.openInputStream();
input.read(photoRaw);
} catch (EOFException e) {}
setPhotoFile(photoRaw);and send them as a parameter. But when I create the java ImageIcon with this byte[] on server i get a "Unsupported JPEG process: SOF type 0xcf" (something related to a "lossless" operation on jpg image). Am I creating the byte[] in the better way?
After many work arounds (all unsucceful), I tough that maybe I can use an httpconnection to send the image to the server and there I would figure out how to use it, but I don't have a clue on how to do this. Any ideas?
I really don't care the format of the image that reach the server, as long as I can see it
. I'm using JDE 5.0 on device side, and JBoss on server side.