Wednesday, February 5, 2014

After upload pictures on the camera


            
The server is. Net of webservices
Probably the case that, android end to save the picture to the Bitmap, converting the Bitmap data stream byte [], then the byte [] convert string to string through ksoap2 transmission A method of receiving string parameter in net webservices within , then this method which will be converted to string. jpg picture.
Question 1: My server-generated jpg file open, file size photographs with android end sample sizes.
I infer that the conversion and upload process, string is truncated, leading to the file can not be opened.
Ask:
1 I use the phone to transfer photos to webservices client approach is string, the length is not too long. Net was intercepted.
Are 2.webservices I post up the String length limit?
3 is not my idea of ​​a problem? There are other more simple way?
Reply:
Just checked the online code is written string found someone to post it! . But my question is where are they -
Reply:
The Bitmap converted into byte and then turned into a String and then upload, it is more nonsense approach.
The usual practice is to use a multi-part upload, a little bit of trouble, you need to write code.
So someone thought of a lazy way, the byte stream using Base64 encoding look into a string, then Post to the server.
Server-side access to the field with a byte stream Base64 decoding, saved as JPG / PNG.
This way you can try a small picture, the big picture, then all kinds of performance problems, memory overflow ......
Reply:
Neighborhoods, I uploaded a picture post, httpURLConnection uploaded successfully httpURLConnection.getResponseCode () = 200, post this information on behalf of my already successful, why my server does not receive the pictures.
I ask again, the server is an ordinary file upload feature pages are not? Others do not need special treatment?
Reply:
It depends on the background code, do not know how to write code behind you can not answer
Reply:
Thank you very much! The background is the problem of code!

No comments:

Post a Comment