fix content type
This commit is contained in:
parent
e1b5b977b7
commit
49614bb7bd
8
main.ts
8
main.ts
@ -147,13 +147,17 @@ export default class SaveRemotePlugin extends Plugin {
|
|||||||
fileOrFolder.path
|
fileOrFolder.path
|
||||||
);
|
);
|
||||||
new Notice(`file ${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(
|
const results = await s3Client.send(
|
||||||
new PutObjectCommand({
|
new PutObjectCommand({
|
||||||
Bucket: this.settings.s3BucketName,
|
Bucket: this.settings.s3BucketName,
|
||||||
Key: `${fileOrFolder.path}`,
|
Key: `${fileOrFolder.path}`,
|
||||||
Body: Buffer.from(arrContent),
|
Body: Buffer.from(arrContent),
|
||||||
ContentType:
|
ContentType: contentType,
|
||||||
mime.contentType(`${fileOrFolder.path}`) || undefined,
|
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user