Questions tagged [multipartentity]

MultipartEntity is successor of HttpEntity, contained in HttpMime API since version 4.0. It's use is primary to simplify process of posting multipart content over HTTP. It allows to add multiple parts of different content-type and encoding.

MultipartEntity, part of HttpMime 4.0 and later. Allows you to put multiple parts, separated by boundary strings and encoded using given charset, into request.

It can have different modes, based on HttpMultipartMode constants. RFC Strict mode ( RFC 822, RFC 2045, RFC 2046 compliant ) and Browser compatible mode.

Each part of request is set via addPart(String name, ContentBody body) or addPart(FormBodyPart body) method.

Note that request, can have only one entity set, so all data must be fit in MultipartEntity object.

232 questions
1
vote
0 answers

How to Change Header application/octet-stream to image/jpg while uploading a file from android

I am uploading a file form sd card to server, for that i am using AndroidMultiPartEntity but i have to change header content-type application/octet-stream to image/jpg defaultly it is taking application/octet-stream My Code: AndroidMultiPartEntity…
NareshRavva
  • 823
  • 3
  • 21
  • 50
1
vote
1 answer

Uploading file using multipartformentity to php script (file ends up in $_POST)

I have an android app which uses the multipartentity from apache httpcomponents. The app uploads a file using an HTTP request to a php script. However, the file that I am uploading (.ogg) ends up in $_POST instead of $_FILES and it looks like…
Andrew Senner
  • 2,479
  • 1
  • 18
  • 24
1
vote
0 answers

UrlEncodedFormEntity vs. MultipartEntity?

What is the main differents between UrlEncodedFormEntity and MultipartEntity? When should I use UrlEncodedFormEntity and when should I use MultipartEntity?
Max_Salah
  • 2,407
  • 11
  • 39
  • 68
1
vote
1 answer

Add MulitpartEnityBuilder to HttpURLConnection

I want to send some text and an image to server. I am using MultipartEntityBuilder for this purpose. But as of API 22 HttpEntity is depreciated. So, how should I add my multipart to the HttpURLConnection? HttpURLConnection conn = (HttpURLConnection)…
Atif Farrukh
  • 2,219
  • 2
  • 25
  • 47
1
vote
1 answer

How to cancel image and video upload like whatsapp

I am uploading an image and video on to a php server, using multipart. I want to be able to cancel the upload when user presses button like whatsapp. The progress is shown correctly but I just want to cancel upload on click but I don't know how.…
1
vote
1 answer

Multipart entity multiple image not sending

In my app I am trying to send multiple images to server..for that I follow this example http://www.mayanklangalia.blogspot.in/2014/04/how-to-upload-multiple-images-on-php.html Following is my code,when i run app image not submitting to server,and in…
user4767117
1
vote
1 answer

How to get all files from directory, save on ArrayList and send it with MultipartEntityBuilder - Android

I need get all Files from Directory on my sdCard and later send ArrayList to PHP server, but I save good my ArrayList but always it send Empty but its compile, not repots any errors. My code private class MyAsyncTask extends AsyncTask
Aspicas
  • 4,498
  • 4
  • 30
  • 53
1
vote
1 answer

Only the original thread that created a view hierarchy can touch its views - Android

I'm using MultipartEntityBuilder to send images to php server, I take pics and videos to device camera to a directory, and I need to save files on new ArrayList and send it to php server. Always it's reports an error: my code private class…
Aspicas
  • 4,498
  • 4
  • 30
  • 53
1
vote
1 answer

Sending file multipart from android to server

I am trying to send a file to a server with the following code private static HttpEntity getHttpEntity(File[] files, List otherParams, String fileName) { MultipartEntityBuilder entity =…
Lena Bru
  • 13,521
  • 11
  • 61
  • 126
1
vote
0 answers

How can I view the full URL after using MultipartEntityBuilder?

I am fairly confident this code works (I used it in another part of my project for a different API) as far as posting but I do not think the URL is being formatted correctly. I want to know if there is anyway to view the full URL after building all…
Troy Zuroske
  • 762
  • 1
  • 12
  • 31
1
vote
1 answer

How to get the text from addTextBody in a MultipartEntityBuilder?

I am using an Android client to post data and some file in Google cloud storage: MultipartEntityBuilder entityBuilder = MultipartEntityBuilder.create(); entityBuilder.setMode(HttpMultipartMode.BROWSER_COMPATIBLE); …
Kritias
  • 187
  • 1
  • 12
1
vote
1 answer

How to couple MultipartEntity and List array to send in httppost in android

I am trying to upload a document file to a server using a MultipartEntity. The document is suppose to be uploaded to a particular user account(ie. the users email). So what i did is that I have a List array of namevaluepairs which contains key value…
1
vote
3 answers

How to send multiple string variable using MultipartEntity from Android

I am trying to send images and values of Latitude and Longitude using MultipartEntity.Values of Latitude and Longitude are stored in a separate variable named plat and plong. I am able to sends images to the server but not both Latitude and…
user3393926
  • 1,169
  • 1
  • 8
  • 17
1
vote
2 answers

HttpPost returning error when using MultipartEntityBuilder in Android

I am trying to query "http://www.idmypill.com/api/id/" api and the JSON string I am receiving back is {"results":[],"success":false,"errors":null} This is my service handler class: public String makeServiceCall(String url, int method, …
Troy Zuroske
  • 762
  • 1
  • 12
  • 31
1
vote
5 answers

Get Progress of File Upload using HttpPost in Android

I am trying to get the progress of the actual file upload using HttpPost. I have a stable solution so far (that i found here in SO) that has a progress but after uploading large files i realized it only counts the bytes written to the output buffer…
el producer
  • 321
  • 3
  • 9