文件
try {
CloudFile avatar = Storage.uploadFile(file.getName(), "gallery", Files.readAllBytes(file.toPath()));
user.put(User.AVATAR, avatar.getPath());
user.save();
// 操作成功
} catch (Exception e) {
Log.d(TAG, e.getMessage(), e);
// 操作失败
}try {
CloudFile file = Storage.file(avatar.getId());
// 操作成功
} catch (Exception e) {
Log.d(TAG, e.getMessage(), e);
// 操作失败
}Last updated
Was this helpful?