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
3
votes
3 answers

Parsing a multi-part response from a http get

I'm developing an integration between 2 applications. Application 1 uses HttpClient GetMethod to request from Application 2. Application 2 will return a multipart response with files embedded. I thought this was a simple exercise, but cannot seem…
Vince
  • 31
  • 1
  • 3
3
votes
0 answers

MultipartEntityBuilder requires httpcore, but this is causing conflict with internal version. Any fixes?

I am working on an app which requires the use of MultipartEntityBuilder. To use this I have included org.apache.httpcomponents:httpmime:4.4 Here is the code snippet from the app: MultipartEntityBuilder builder = MultipartEntityBuilder.create(); …
3
votes
1 answer

android Error:Execution failed for task ':app:packageDebug'

my function public static String postFile(String url,String fileName, String userName) throws Exception { HttpClient client = new DefaultHttpClient(); HttpPost post = new HttpPost(url); MultipartEntityBuilder builder =…
3
votes
2 answers

Onedrive API file Upload using Java

I am trying to upload a file into OneDrive folder using POST REST call. My application is able to communicate with OneDrive. The response I am getting says The request entity body isn't a valid JSON object. Below is my Code, Kindly let me know the…
manurajhada
  • 5,284
  • 3
  • 24
  • 43
3
votes
1 answer

Android: binary photo not sent while using multipartentity

Here is the code I wrote to send a binary file along some strings to a PHP web application server. public void doRegister(final String userEmail, final String userPass, final File userPhotoId) { HttpClient myHttpClient = new…
kevoroid
  • 5,052
  • 5
  • 34
  • 43
3
votes
1 answer

Android - Sending 2 files to a server

I am trying to make an android app in which i can take or choose 2 pics from the gallery and send them to a server. The code: private static final int SELECT_PICTURE = 1; private String selectedImagePath; private int TAKE_PHOTO_CODE = 0; private Uri…
user1649498
  • 121
  • 3
  • 15
3
votes
1 answer

NoClassFoundError MultipartEntity error in android

I am not able to figure this problem out.I added the following jars. httpClient-4.2.5.jar httpcore-4.2.4.jar httpmime-4.2.5.jar I added these jar through Add External JARs option in Build Paths and then added them manually in the libs folder of my…
Mj1992
  • 3,404
  • 13
  • 63
  • 102
3
votes
0 answers

Out of memory Exception during base64 encoding in android?

I have to upload four images from android to server using multipart entity.I am sending images by decoding it with base64.And it shows out of memory exception.I have posted the code below. Please help me fixing the bug. private String resize(String…
SREEJITH
  • 816
  • 1
  • 8
  • 19
3
votes
1 answer

How to serialise an HttpPost request to be sent later

I wanted to save the HTTP Post request in case of network failure/ unavailability so that when network returns I can send it then. I am not sure if its possible, but it will be great if there is a way to do so. I use MultipartEntity to create the…
the100rabh
  • 4,077
  • 4
  • 32
  • 40
2
votes
3 answers

Can I write multiple byte arrays to an HttpClient without client-side buffering?

The Problem I would like to upload very large files (up to 5 or 6 GB) to a web server using the HttpClient class (4.1.2) from Apache. Before sending these files, I break them into smaller chunks (100 MB, for example). Unfortunately, all of the…
Jonah Bishop
  • 12,279
  • 6
  • 49
  • 74
2
votes
1 answer

Android: upload file with filling out POST body together

I do use MultipartEntity to send File to server, it appears correctly in $_FILES superglobal But I need also fill in POST body to be read via php://stdin How can I do that? current snippet below: ByteArrayOutputStream bos = new…
Marek Sebera
  • 39,650
  • 37
  • 158
  • 244
2
votes
0 answers

Not able to fetch response from Multipart in android

I am working on an application in which I need to upload image on server with several parameters. I am using multipart functionality to upload image on server. I am using 'net.gotev:uploadservice:2.1' library to upload image on server. I am able to…
2
votes
0 answers

How to send Image to server with out downloading it to memory?

I'm getting Facebook profile image url, what I'm doing is downloading that image to the memory using String extension = filePath.substring(filePath.lastIndexOf(".")); ContentValues values = new ContentValues(); …
Praneeth
  • 1,260
  • 18
  • 37
2
votes
1 answer

post file with httpcomponents. Something wrong with memory

I'm trying to send file on my rest service. I'm using apache httpcomponents 4.3. It works, but it use about 600 MB. Always, if file 200 KB or 15 GB it use 600 MB of Ram. If I remove addPart - memory is OK. So, why file sending get so much…
Andrew
  • 399
  • 5
  • 17
2
votes
0 answers

Image upload with MultipartEntityBuilder

I have following class, but don't know, how to resolve ContentType. Why cannot be used writeTo() method with created entity? I cannot write it to ByteOutputStream. public class ImageUploadRequest extends Request { private static final…
plaidshirt
  • 5,189
  • 19
  • 91
  • 181
1 2
3
15 16