文档模块支持上传客户自己的本地文档。
说明
支持类型:ppt、pptx、pdf。
每次上传任务限定PPT不超过100页、文件大小不超过100MB。
API使用示例
iOS:
id<AIRBRoomChannelProtocol> room = [[AIRBRoomEngine sharedInstance] getRoomChannelWithRoomID:@"xxx"];
[room.document uploadDocument:@"这里传入文件的地址" onSuccess:^(NSString *documentID) {
NSLog(@"上传成功,对应的id是%@", documentID);
} onFailure:^(NSString *errorMessage) {
NSLog(@"上传失败");
}];
Android:
documentService.upload(uri, new Callback<String>() {
@Override
public void onSuccess(final String docId) {
Logger.i(TAG, "upload onSuccess: " + docId);
}
@Override
public void onError(String errorMsg) {
Logger.e(TAG, "onError: " + errorMsg);
}
});
Web:
docService.upload(file).then(docId => {
console.log('上传成功,docId为', docId);
});
Windows:
auto iroom_ptr =
alibaba::meta_space::MetaSpace::GetInstance()->GetRoomInstance(
.room_id);
std::shared_ptr<IDoc> doc_plugin =
std::dynamic_pointer_cast<IDoc>(iroom_ptr->GetPlugin(PluginDoc));
std::string file_path;
std::string doc_name;
std::string doc_type;
std::string room_id;
bool private_path = true;
doc_plugin->UploadFile(file_path, doc_name, doc_type, room_id, private_path,
[](size_t increment, int64_t transferred, int64_t total){},
[](const std::string& doc_id){},
[](const ::alibaba::dps::DPSError& err){});
文档内容是否对您有帮助?