mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2025-09-13 18:15:31 +08:00
parent
b706774b5b
commit
ec01aef71a
2 changed files with 4 additions and 3 deletions
|
@ -3,6 +3,7 @@ export enum CompressType {
|
|||
Gz = 'gz',
|
||||
Bz2 = 'bz2',
|
||||
Tar = 'tar',
|
||||
TGz = 'tgz',
|
||||
TarGz = 'tar.gz',
|
||||
Xz = 'xz',
|
||||
Rar = 'rar',
|
||||
|
@ -14,6 +15,7 @@ export enum CompressExtension {
|
|||
gz = '.gz',
|
||||
bz2 = '.tar.bz2',
|
||||
tar = '.tar',
|
||||
tgz = '.tgz',
|
||||
'tar.gz' = '.tar.gz',
|
||||
xz = '.tar.xz',
|
||||
rar = '.rar',
|
||||
|
@ -26,6 +28,7 @@ export const MimetypeByExtensionObject: Record<string, string> = {
|
|||
'.tar.bz2': 'application/x-bzip2',
|
||||
'.bz2': 'application/x-bzip2',
|
||||
'.tar.gz': 'application/gzip',
|
||||
'.tgz': 'application/x-gzip',
|
||||
'.gz': 'application/gzip',
|
||||
'.xz': 'application/x-xz',
|
||||
'.rar': 'application/x-rar-compressed',
|
||||
|
|
|
@ -1033,11 +1033,9 @@ const openDeCompress = (item: File.File) => {
|
|||
MsgWarning(i18n.global.t('file.canNotDeCompress'));
|
||||
return;
|
||||
}
|
||||
|
||||
fileDeCompress.mimeType = item.mimeType;
|
||||
if (CompressExtension[Mimetypes.get(item.mimeType)] != item.extension) {
|
||||
fileDeCompress.mimeType = MimetypeByExtensionObject[item.extension];
|
||||
} else {
|
||||
fileDeCompress.mimeType = item.mimeType;
|
||||
}
|
||||
|
||||
fileDeCompress.name = item.name;
|
||||
|
|
Loading…
Add table
Reference in a new issue