Well, I wonder how I can achieve to publish multi-page mode. I have 3 parts, and files that can be large should be sent to pieces.
That's what I'm doing:
MultipartEntity multipartEntity = new MultipartEntity() { @Override public boolean isChunked() { return true; } }; multipartEntity.addPart("theText", new StringBody("some text", Charset.forName("UTF-8"))); FileBody fileBody1 = new FileBody(file1); multipartEntity.addPart("theFile1", fileBody1); FileBody fileBody2 = new FileBody(file2); multipartEntity.addPart("theFile2", fileBody2); httppost.setEntity(multipartEntity); HttpParams params = new BasicHttpParams(); HttpProtocolParams.setVersion(params, HttpVersion.HTTP_1_1); HttpClient httpClient = new DefaultHttpClient(params); HttpResponse httpResponse = httpClient.execute(httppost);
On the server side, I get 3 parts, but the files, for example, are not divided, they are accepted as one part ... basically I see only 4 borders: 3 --xxx, 1 at the end --xxx--. I thought that overriding isChunked would do the trick, but no ...; (
Am I trying to do what I do? How could I do this job?
Many thanks. Fab
Fab
source share