mirror of
https://github.com/ant-design/ant-design.git
synced 2025-08-06 16:06:28 +08:00
scripts: set correct content-type when uploading image (#47263)
* scripts: set correct content-type when uploading image * chore: update
This commit is contained in:
parent
f1f4788e38
commit
057e81f11d
@ -93,6 +93,10 @@ async function uploadFile(client, filePath, refValue) {
|
||||
// https://help.aliyun.com/zh/oss/developer-reference/prevent-objects-from-being-overwritten-by-objects-that-have-the-same-names-3
|
||||
'x-oss-forbid-overwrite': 'false',
|
||||
};
|
||||
// Set content-type to allow individual preview of images
|
||||
if (path.extname(filePath) === '.png') {
|
||||
headers['Content-Type'] = 'image/png';
|
||||
}
|
||||
|
||||
console.log('Uploading file: %s', filePath);
|
||||
try {
|
||||
|
Loading…
Reference in New Issue
Block a user