Skip to content

Commit

Permalink
Merge pull request valor-software#927 from Amos47/development
Browse files Browse the repository at this point in the history
Expand compression mime types
  • Loading branch information
Adrian Fâciu authored Dec 9, 2017
2 parents e423a30 + 7d25b57 commit fb48f44
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/file-upload/file-type.class.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { FileLikeObject } from "../ng2-file-upload";

export class FileType {
/* MS office */
public static mime_doc: string[] = [
Expand Down Expand Up @@ -50,10 +52,15 @@ export class FileType {
'application/compress',
'application/x-tar',
'application/x-rar-compressed',
'application/octet-stream'
'application/octet-stream',
'application/x-zip-compressed',
'application/zip-compressed',
'application/x-7z-compressed',
'application/gzip',
'application/x-bzip2'
];

public static getMimeClass(file: any): string {
public static getMimeClass(file: FileLikeObject): string {
let mimeClass = 'application';
if (this.mime_psd.indexOf(file.type) !== -1) {
mimeClass = 'image';
Expand Down Expand Up @@ -112,6 +119,8 @@ export class FileType {
'7z': 'compress',
'lz': 'compress',
'z01': 'compress',
'bz2': 'compress',
'gz': 'compress',
'pdf': 'pdf',
'xls': 'xls',
'xlsx': 'xls',
Expand Down

0 comments on commit fb48f44

Please sign in to comment.