Reputation: 871
client :: android
The data i have encoded comprised of string and image
Now on decoding on server should i decode the data into binary to store it all together?
Or Should i need to decode a string to a particular format and image to particular format- If so what are those formats ?
My endgoal::
I am confused with Base64format, Jpgformat etc
Any guidance on this
For image
it is like this::
I need to be able to see the image when i give its location URL in server....
with this regard i need to store it in server .....
How should i process the posted Base64 encoded image in server ?
for string it is like this::
Note:: I never use Decoding on client when GET is used to get the data which are uploaded to server as Base64 encoded !
Upvotes: 1
Views: 76
Reputation: 18933
It will Depends on your server side.. That how do you want to Store the Image??? If you want to save your image as a filepath or only as a image path then after it will be converted to byteStream.
If you want to save your image as byte array then you can also do that...after that you don't need to decoding..... And after that you can save your image to your Database.....
For String:
When you are posting the string then no need for decoding....And it is used when you need to remove some special characters from your String...
Like:
String name = URLDecoder.decode("yourString","UTF-8");
after that you can save your String in your Database.....
Upvotes: 1
Reputation: 464
please read follwing link .....how to store image in servier
http://reecon.wordpress.com/2010/04/25/uploading-files-to-http-server-using-post-android-sdk/
Upvotes: 1