|
@@ -82,10 +82,11 @@ public class S3FileClient extends AbstractFileClient<S3FileClientConfig> {
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public String upload(byte[] content, String path) throws Exception {
|
|
|
+ public String upload(byte[] content, String path, String type) throws Exception {
|
|
|
// 执行上传
|
|
|
client.putObject(PutObjectArgs.builder()
|
|
|
.bucket(config.getBucket()) // bucket 必须传递
|
|
|
+ .contentType(type)
|
|
|
.object(path) // 相对路径作为 key
|
|
|
.stream(new ByteArrayInputStream(content), content.length, -1) // 文件内容
|
|
|
.build());
|