09-14-2009 03:28 PM
I am writing some data to the server which involves a JSON string as well as some images. I encode the JSON string using URLEncodedPostData with a UTF-8 character encoding and I am writing the bytes of the file to the same output stream. For some reason on the server side, Tomcat in this case, I see a bunch of Character decoding failed exceptions.
Does anyone know where I might be going wrong from this high level overview? Any suggestions as to an article or tutorial? All help much appreciated.
09-14-2009 05:58 PM
I was using iso-..... and it seems the server wanted UTF-8. I changed this around and that seemed to solve the character encoding problem. The issues I have now is that everything seemingly get's written to the server (server responds with 200 and success reply) but, the images that I write to the output stream are never written to a file on the server side.
There are images created on the server but they are all of 0 bytes in length. Is there anything specifically needed when writing images from the BB to a server such? Thanks!
09-15-2009 12:47 AM
I am reading the file from the file system/sd card using an implementation of the JSR75 spec which then returns the file as a byte array. I then write this array out to the OutputStream of the HTTPConnection. I have heard that some transport protocols required base64 encoding, is this something I need for this scenario or is there something else? Thank you for all of your help.