1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
| String expectKey = UUID.randomUUID().toString();
String eKey=expectKey.replaceAll("-","");
uploadManager.put(b, eKey, uptoken, new UpCompletionHandler() {
public void complete(String k, ResponseInfo rinfo, JSONObject response) {
String s = k + ", "+ rinfo + ", " + response;
String key = getKey(k, response);
Log.e(TAG, s + "\n" + "http://" + bucketName + "qiniudn.com/" + key);
if (rinfo.isOK()) { // 上传成功
Toast.makeText(BusinessAuthenticationActvity.this, "上传成功", 0).show();
} else { // 上传失败
Toast.makeText(BusinessAuthenticationActvity.this, "上传失败", 0).show();
}
}
}, new UploadOptions(null, "image/jpg", true, null, null));
} |