You can pass an array of files as a value for the file key. To do this, run the following code:
File[] myFiles = { new File("pic.jpg"), new File("pic1.jpg") };
RequestParams params = new RequestParams();
try {
params.put("profile_picture[]", myFiles);
} catch(FileNotFoundException e) {
}
Alternatively, if you want a dynamic array, you can use an ArrayList and convert to type File [] using the .toArray () method
ArrayList<File> fileArrayList = new ArrayList<>();
File[] files = new File[fileArrayList.size()];
fileArrayList.toArray(files);
I hope for this help. = D
source
share