我已经将图像上传到cloudinary,但是我不知道如何获取响应并将保存的URL值存储在数据库中。 这是上载它的代码,并且可以正常工作。
MediaManager.get().upload(Uri.fromFile(filePath))
.option("resource_type", "image")
.option("folder", "FuegoSanto/avatar/")
.option("use_filename", "true")
//.option("public_id", nombreImagen)
.option("version","currentTimeMillis")
.option("overwrite", true)
.option("notification_url", "https://mysite.example.com/notify_endpoint")
.dispatch();
这是期望的响应
{
public_id: 'sample',
version: '1312461204',
width: 864,
height: 564,
format: 'jpg',
created_at: '2017-08-10T09:55:32Z',
resource_type: 'image',
tags: [],
bytes: 9597,
type: 'upload',
etag: 'd1ac0ee70a9a36b14887aca7f7211737',
url: 'http://res.cloudinary.com/demo/image/upload/v1312461204/sample.jpg',
secure_url: 'https://res.cloudinary.com/demo/image/upload/v1312461204/sample.jpg',
signature: 'abcdefgc024acceb1c1baa8dca46717137fa5ae0c3',
original_filename: 'sample'
}
So the idea is to take the value URL and store it in database.