Closed 1343228975 closed 9 months ago
提供版本号、配置文件、相关代码以及完整的报错信息
version:2.0.0 配置文件: dromara: x-file-storage: #文件存储配置,不使用的情况下可以不写 default-platform: amazon-s3-1 #默认使用的存储平台 thumbnail-suffix: ".min.jpg" #缩略图后缀,例如【.min.jpg】【.png】 minio: # MinIO,由于 MinIO SDK 支持 Amazon S3,其它兼容 Amazon S3 协议的存储平台也都可配置在这里
platform: amazon-s3-1 # 存储平台标识 enable-storage: true # 启用存储 access-key: ** secret-key: *** region: ?? # 与 end-point 参数至少填一个 end-point: eos-chengdu-1.cmecloud.cn # 与 region 参数至少填一个 bucket-name: ai-farm domain: http://eos-chengdu-1.cmecloud.cn/ai-farm/ # 访问域名,注意“/”结尾,例如:https://abc.hn-bkt.clouddn.com/ base-path: ai-farm/ # 基础路径 相关代码: FileStorage fileStorage = fileStorageService.getFileStorage(); boolean supportACL = fileStorageService.isSupportAcl(fileStorage); // 保存视频到指定路径下 FileInfo fileInfo = fileStorageService.of(file) // 保存到相对路径下,为了方便管理,不需要可以不写 .setPath("res/" + DateUtils.datePath() + "/") .setProgressMonitor(new ProgressListener() { @Override public void start() { log.info("上传开始"); }
@Override
public void progress(long progressSize, long allSize) {
//log.info("已上传 " + progressSize + " 总大小" + allSize);
}
@Override
public void finish() {
log.info("上传结束");
}
})
// 关联对象id,为了方便管理,不需要可以不写
.setAcl(Constant.ACL.PRIVATE)
.setObjectId("0")
.setContentType("video/mp4")
// 关联对象类型,为了方便管理,不需要可以不写
.setObjectType(ImgTypeEnum.FILE_TYPE_RES_MP4.name())
// 保存一些属性,可以在切面、保存上传记录、自定义存储平台等地方获取使用,不需要可以不写
.putAttr("role", "admin")
// 使用指定的存储平台
.setPlatform("amazon-s3-1")
.upload();
// 设置视频的ACL为公开读
fileStorageService.setFileAcl(fileInfo, Constant.ACL.PUBLIC_READ);
fileStorageService.setThFileAcl(fileInfo, Constant.ACL.PUBLIC_READ);
log.info("视频上传成功,url:{}", fileInfo.getUrl());
报错信息 "extraInfo": "If the request involves an input stream, the maximum stream buffer size can be configured via request.getRequestClientOptions().setReadLimit(int)", "retryable": false, "message": "The request to the service failed with a retryable reason, but resetting the request input stream has failed. See exception.getExtraInfo or debug-level logging for the original failure that caused this retry.; If the request involves an input stream, the maximum stream buffer size can be configured via request.getRequestClientOptions().setReadLimit(int)", "localizedMessage": "The request to the service failed with a retryable reason, but resetting the request input stream has failed. See exception.getExtraInfo or debug-level logging for the original failure that caused this retry.; If the request involves an input stream, the maximum stream buffer size can be configured via request.getRequestClientOptions().setReadLimit(int)",
换成2.1.0试试
好的
上传视频的时候 the maximum stream buffer size can be configured via request.getRequestClientOptions().setReadLimit