Hi All,
I am looking for a solution to recieve an image in webservices through my client(Android application).
I am sending an image as a string(converting image to byte array and then byte array to Base64String).While recieving at server end (in services ) i need to decode the string back to image so i am using following code.
byte[] decode=Base64.decodeBase64(signature.getBytes());
BufferedImage img = ImageIO.read(new ByteArrayInputStream(decode));
FileOutputStream fos = new FileOutputStream(imageFile);
fos.write(decode);
here:
signature is the string recieved from client end.
imageFile is the path (in the code) to save the image in the required folder .
By above code i am recieving the blank image with some bytes(ex.7 bytes).
wanted to fetch the complete image not the bytes.
Please give some solution for the code.
Any new solutions are appreciated.


LinkBack URL
About LinkBacks
Reply With Quote