0

How to send a multiple image in sd card android to web server? Two images or more?

This is my code

Bitmap bitmapOrg =BitmapFactory.decodeFile("/sdcard/Plant/pupuk/134681282302.jpg");
ByteArrayOutputStream bao = new ByteArrayOutputStream();
bitmapOrg.compress(Bitmap.CompressFormat.JPEG, 90, bao);
byte[] ba = bao.toByteArray();
String ba1 = Base64.encodeBytes(ba);
ArrayList<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>();
nameValuePairs.add(new BasicNameValuePair("image", ba1));

I only found the way to select a single image. I can't send two or more image to web server.

Thanks for your attention. sorry for my bad english.

cheers

Alex

4

2 に答える 2

0

さまざまなキーで送信できます。

ArrayList<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>();
nameValuePairs.add(new BasicNameValuePair("image1", ba1));
nameValuePairs.add(new BasicNameValuePair("image2", ba2));
nameValuePairs.add(new BasicNameValuePair("image3", ba3));
.
.
于 2012-09-10T08:04:09.793 に答える
0

それは、サーバーが何を期待しているかによって異なります。投稿したコードが機能する場合は、単純に反復して複数の画像を送信できます

于 2012-09-10T08:13:49.583 に答える