如何使用AsyncHttpClient Android上传多个文件

Yog*_*ari 7 post android multipart android-async-http

我知道我可以从AsyncHttpClient上传单个文件

http://loopj.com/android-async-http/

File myFile = new File("/path/to/file.png");
RequestParams params = new RequestParams();
try {
    params.put("profile_picture", myFile);
} catch(FileNotFoundException e) {}
Run Code Online (Sandbox Code Playgroud)

但我必须使用multipart post将多个文件上传到服务器.我怎样才能做到这一点?

Raf*_*hes 1

创建 SimpleMultipartEntity 对象并为要上传的每个文件调用 addPart。