这里的uploadChunk方法调用了addMediaFilesToMinIO方法 :boolean b = addMediaFilesToMinIO(localChunkFilePath, mimeType, bucket_video, chunkFilePath);localChunkFilePath, mimeType两个参数都是String类型,但是刚开始我把俩顺序搞反了,导致无法识别存储到Minio的路径,始终无法上传文件!!!调试了一个小时,做开发真的得细心细心加细心啊!!
@Override
public RestResponse uploadChunk(String fileMd5, int chunk, String localChunkFilePath) {
//获取mimeType
String mimeType = getMimeType(null);
//分块文件路径
String chunkFilePath = getChunkFileFolderPath(fileMd5) + chunk;
//将分块文件上传minio
//String localFilePath,String mimeType,
//String bucket, String objectName
boolean b = addMediaFilesToMinIO(localChunkFilePath, mimeType, bucket_video, chunkFilePath);
if(!b){
return RestResponse.validfail(false,"上传分块文件失败");
}
return RestResponse.success(true);
}