Android SDK Samples - Files Operations
Download File from ZFS(Zoho Files System)
Upload File to ZFS using fileRequestRefId and filePath
val fileRequestRefId = "uploadFiles" + System.currentTimeMillis().toString()
val filepath = "File(smallImagePath).absolutePath"
//Call uploadFile() by passing the fileRequestRefId and filePath.
//fileRequestRefId - reference id which is used as a tag to this api request
//filePath - Path of the file to be uploaded
ZCRMSDKUtil.uploadFile(fileRequestRefId, filepath, object:FileWithDataTransferTask<APIResponse,String>
{
override fun onCompletion(response: APIResponse, zcrmEntity: String) {
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 File to ZFS using fileRequestRefId and uri
//Call uploadFile() by passing the fileRequestRefId and uri
//fileRequestRefId - reference id which is used as a tag to this api request
//uri - uri of the file to be uploaded
ZCRMSDKUtil.uploadFile(fileRequestRefId, uri, object : FileWithDataTransferTask<APIResponse,String>
{
override fun onCompletion(response: APIResponse, zcrmEntity: String) {
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}")
}
})