smriti3
smriti3

Reputation: 871

POSTING data to server and reading it on server end

I have followed the process of encoding the data in android Using Base64

client :: android

  1. The data i have encoded comprised of string and image

  2. Now on decoding on server should i decode the data into binary to store it all together?

  3. 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

{EDIT}

For image

it is like this::

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

Answers (2)

Piyush
Piyush

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

prakash
prakash

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

Related Questions