Upload Image Response Issue in android
When i upload multiple image at same time than it returns same response.
i am using tag concept on it
String tag = "source=Profile";
String requestId = MediaManager.get().upload(path)
.unsigned("sample_app_preset")
.option("tags", tag)
.constrain(TimeWindow.immediate())
.callback(new UploadCallback() {
@Override
public void onStart(String requestId) {
Log.d("onStart",requestId);
// your code here
}
@Override
public void onProgress(String requestId, long bytes, long totalBytes) {
// example code starts here
Double progress = (double) bytes / totalBytes;
// post progress to app UI (e.g. progress bar, notification)
// example code ends here
}
@Override
public void onSuccess(String requestId, Map resultData) {
// your code here
Log.d("onSuccess",requestId);
if (resultData != null && resultData.size() > 0) {
if (resultData.containsKey("url")) {
String imageURL = (String) resultData.get("url");
String cloudinaryID = (String) resultData.get("public_id");
int width = (Integer) resultData.get("width");
int height = (Integer) resultData.get("height");
if (imageURL != null && !StringUtils.isEmpty(imageURL)) {
//logic here
}
}
}
}
@Override
public void onError(String requestId, ErrorInfo error) {
// your code here
}
@Override
public void onReschedule(String requestId, ErrorInfo error) {
// your code here
}
})
.dispatch();
}
all things is working fine now , image also upload on cludinary web portal but it return same result at multiple time
that mean if we upload 3 image than
same url retruns at 3 times in response
Post is closed for comments.
Comments
3 comments