use of com.ning.http.multipart.FilePart in project new-cloud by xie-summer.
the class AsyncHttpUtils method uploadFile.
public static void uploadFile(String url, Map<String, String> params, File file, String inputName, String fileName, HttpResultCallback callback) {
try {
BoundRequestBuilder rb = getDefault().preparePost(url);
setPostParams(params, rb);
FilePart part = new FilePart(inputName, fileName, file);
rb.addBodyPart(part);
rb.execute(new AsynchHandler(callback));
} catch (IOException e) {
DB_LOGGER.error(e, 30);
}
}
Aggregations