fix content type

This commit is contained in:
fyears 2021-10-21 09:46:58 +08:00
parent e1b5b977b7
commit 49614bb7bd
1 changed files with 6 additions and 2 deletions

View File

@ -147,13 +147,17 @@ export default class SaveRemotePlugin extends Plugin {
fileOrFolder.path
);
new Notice(`file ${fileOrFolder.path}`);
const contentType =
mime.contentType(
mime.lookup(`${fileOrFolder.path}`) || undefined
) || undefined;
console.log(contentType);
const results = await s3Client.send(
new PutObjectCommand({
Bucket: this.settings.s3BucketName,
Key: `${fileOrFolder.path}`,
Body: Buffer.from(arrContent),
ContentType:
mime.contentType(`${fileOrFolder.path}`) || undefined,
ContentType: contentType,
})
);
}