java - 从 cloudinary 上传图像时,如何返回 cloudinary 的响应?
问题描述
我已经将我的图像上传到 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.
解决方案
推荐阅读
- idris - 编译器在使用返回依赖对的函数时引入了额外的接口要求
- javascript - 表单提交在 ios 设备上不起作用
- rust - 使用 Serde 反序列化时如何忽略额外的元组项?(“尾随字符”错误)
- sharepoint-online - 难以让“列出组成员”在 Microsoft Flow 中返回正确的 Sharepoint 组信息
- ffmpeg - libx264 和 h264_nvenc 有什么区别?
- reactjs - 什么应该被视为 React 中的组件
- java - Spring 将 Autowired SessionAttribute 注入服务层
- excel - 为 Excel 电子表格插入小计
- javascript - 如何使用 CSS-Grid 和 javascript 制作图像幻灯片
- google-apps-script - 使用单独工作表中的宏清除单元格