Hi ! I'm writing because I didn't find how i can change the type of content Transfer Encoding in a multipart message that i send with a HTTP Post request .
For this, i use the library httpmime-4.1.1.jar from: http://hc.apache.org/htppcomponents-client/httpmime/index.html. In my project, i try to send a base64 JPG but for the moment i have just send a binary JPEG and my hope is so with a base64. Does anyone know how change this content transfer type or help me ? it will be very helpful. I have tried with an instance of FileBody but it was a flop... and i have read the code but i found nothing. Thanks johan S. PS: If I find before, i will write you and sorry for my english ! the piece of code : File photo = new File(Environment.getExternalStorageDirectory() + File.separator + "DCIM", "outs0.jpg"); FileBody fb = new FileBody(photo, "image/jpeg"); HttpClient httpClient = new DefaultHttpClient(); HttpPost httpPost = new HttpPost(adr); MultipartEntity multipartContent = new MultipartEntity(); multipartContent.addPart("infosString", testString); multipartContent.addPart("photo1",fb); try { httpPost.setEntity(multipartContent); HttpResponse response = httpClient.execute(httpPost); HttpEntity httpEntity = response.getEntity(); line = EntityUtils.toString(httpEntity); }catch{...} --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
