Skip to content

Commit 566f46f

Browse files
committed
Modified FilesSample to provide use-case for custom file names via RequestParams
1 parent eb5e647 commit 566f46f

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

sample/src/main/java/com/loopj/android/http/sample/FilesSample.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,13 @@ public RequestHandle executeSample(AsyncHttpClient client, String URL, Header[]
3434
try {
3535
RequestParams params = new RequestParams();
3636
final String contentType = RequestParams.APPLICATION_OCTET_STREAM;
37-
params.put("fileOne", createTempFile("fileOne", 1020), contentType);
37+
params.put("fileOne", createTempFile("fileOne", 1020), contentType, "fileOne");
3838
params.put("fileTwo", createTempFile("fileTwo", 1030), contentType);
39-
params.put("fileThree", createTempFile("fileThree", 1040), contentType);
39+
params.put("fileThree", createTempFile("fileThree", 1040), contentType, "customFileThree");
4040
params.put("fileFour", createTempFile("fileFour", 1050), contentType);
41-
params.put("fileFive", createTempFile("fileFive", 1060), contentType);
41+
params.put("fileFive", createTempFile("fileFive", 1060), contentType, "testingFileFive");
42+
params.setHttpEntityIsRepeatable(true);
43+
params.setUseJsonStreamer(false);
4244
return client.post(this, URL, params, responseHandler);
4345
} catch (FileNotFoundException fnfException) {
4446
Log.e(LOG_TAG, "executeSample failed with FileNotFoundException", fnfException);

0 commit comments

Comments
 (0)