Hello everyone i am trying to upload user profile pic it shows me '{"errors":{"base":["Forbidden. Need user."]}}' this error Please let me know what i am doing wrong
QBContent.uploadFileTask(profilePic, true, new QBCallbackImpl() {
@Override
public void onComplete(Result result) {
if (result.isSuccess()) {
// get uploaded file
QBFileUploadTaskResult fileUploadTaskResult = (QBFileUploadTaskResult) result;
QBFile qbFile = fileUploadTaskResult.getFile();
int uploadedFileID = qbFile.getId();
// Connect image to user
QBUser user = new QBUser();
user.setId(userID);
user.setFileId(uploadedFileID);
QBUsers.updateUser(user, new QBCallbackImpl() {
@Override
public void onComplete(Result result) {
if (result.isSuccess()) {
// Profile picture has changed!
} else {
Log.e("Errors",result.getErrors().toString());
}
}
});
} else {
Log.e("Errors",result.getErrors().toString());
}
}
});