Run your entire business on Zoho with our unified cloud software, designed to help you break down silos between departments and increase organizational efficiency.
//$companyInfo object is of ZCRMCompanyInfo
//call uploadPhoto() using $companyInfo object by passing the fileRequestRefId, filePath and photoViewPermission as parameters
//fileRequestRefId - reference id which is used as a tag to this api request
//filePath - Path of the photo to be uploaded
//photoViewPermission - PhotoViewPermission (NONE, ZOHO_USERS, ORG_USERS, PUBLIC, CONTACTS)
$companyInfo.uploadPhoto("123456789", File(filename).absolutePath, CommonUtil.PhotoViewPermission.ORG_USERS,object : FileTransferTask<APIResponse>{
override fun onCompletion(response: APIResponse) {
println("${response.responseJSON}")
}
override fun onFailure(exception: ZCRMException) {
println("Throws Exception : $exception")
}
override fun onProgressUpdate(bytesWritten: Long, contentLength: Long, percentage: Double) {
println("OnProgress Update : ${bytesWritten}+${contentLength}+${percentage}")
}
})
Upload Company Photo Using URI
File file = new File(Filename);
Uri uriSource = FileProvider.getUriForFile(applicationcontext, "com.example.android.fileprovider", file);
//$companyInfo object is of ZCRMCompanyInfo
//call uploadPhoto() using $companyInfo object by passing the fileRequestRefId, uri and photoViewPermission as parameters
//fileRequestRefId - reference id which is used as a tag to this api request
//uri - Uri of the resource to be uploaded
//photoViewPermission - PhotoViewPermission (NONE, ZOHO_USERS, ORG_USERS, PUBLIC, CONTACTS)
$companyInfo.uploadPhoto("file_req_ref_id", uriSource,CommonUtil.PhotoViewPermission.ORG_USERS, object : FileTransferTask<APIResponse> {
override fun onCompletion(response: APIResponse) {
println("${response.responseJSON}")
}
override fun onFailure(exception: ZCRMException) {
println("Throws Exception : $exception")
}
override fun onProgressUpdate(bytesWritten: Long, contentLength: Long, percentage: Double) {
println("OnProgress Update : ${bytesWritten}+${contentLength}+${percentage}")
}
})