Allowed mime type doesn't support .msg (Outlook) file #811

Open
opened 2017-05-23 07:24:50 +00:00 by karthick-manoharan · 12 comments
karthick-manoharan commented 2017-05-23 07:24:50 +00:00 (Migrated from github.com)

Mime type for .msg

allowedMimeType: [ "application/vnd.ms-outlook", ]

I confirm the file is not supported by observing

this.uploader.onWhenAddingFileFailed = () = { console.log("file not supported"); }

Note: all the other type works fine eg: .docx [application/vnd.openxmlformats-officedocument.wordprocessingml.document], .txt ["text/plain"]

Mime type for .msg `allowedMimeType: [ "application/vnd.ms-outlook", ]` I confirm the file is not supported by observing `this.uploader.onWhenAddingFileFailed = () = { console.log("file not supported"); }` Note: all the other type works fine eg: **.docx** [application/vnd.openxmlformats-officedocument.wordprocessingml.document], **.txt** ["text/plain"]
Ekaanth commented 2017-12-11 12:25:44 +00:00 (Migrated from github.com)

In my case, I'm not able to upload any other format except for pdf.

allowedMimeType: [ "application/pdf", ]

In my case, I'm not able to upload any other format except for pdf. > allowedMimeType: [ "application/pdf", ]
reddevilzee commented 2018-03-29 18:57:37 +00:00 (Migrated from github.com)

It happens same with .xls format as well.
In my case, .xls and .msg is not supporting.
mime types i have used are -
.xls - application/vnd.ms-excel,
.msg - application/vnd.ms-outlook

It happens same with .xls format as well. In my case, .xls and .msg is not supporting. mime types i have used are - .xls - application/vnd.ms-excel, .msg - application/vnd.ms-outlook
koenvanderlinden commented 2018-03-29 19:13:44 +00:00 (Migrated from github.com)

@reddevilzee what version of ng2-fileupload do you use? If I check the currect version of FileType code is see mime type 'application/vnd.ms-excel' is included. So that should be recognized.

@reddevilzee what version of ng2-fileupload do you use? If I check the currect version of FileType code is see mime type 'application/vnd.ms-excel' is included. So that should be recognized.
reddevilzee commented 2018-04-02 20:01:42 +00:00 (Migrated from github.com)

Hi @koenvanderlinden,

I am using the current version 1.3.0. That's correct, I used the mime types available in File Type class in my code piece of allowedMimeTypes. Here is my code piece,

// lookup file
allowedMimeType = [
'image/jpeg', 'image/jpg', 'image/tiff', 'image/gif', 'image/bmp', 'image/png', 'image/bpg', 'image/svg',
'application/pdf', //.pdf
'application/msword', //.doc
'application/vnd.openxmlformats-officedocument.wordprocessingml.document', //.docx
'application/vnd.ms-excel', //.xls
'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', //.xlsx
'application/vnd.ms-outlook', //.msg
'text/plain', //.txt,
'text/html' //.html
];

// ts file
public uploader: FileUploader = new FileUploader({
...
allowedMimeType: this.lookup.allowedMimeType,
...
});

everything else works fine except for .xls and .msg.

uploader.onWhenAddingFileFailed is firing for files which have both of these extensions.

Hi @koenvanderlinden, I am using the current version 1.3.0. That's correct, I used the mime types available in File Type class in my code piece of allowedMimeTypes. Here is my code piece, **// lookup file** allowedMimeType = [ 'image/jpeg', 'image/jpg', 'image/tiff', 'image/gif', 'image/bmp', 'image/png', 'image/bpg', 'image/svg', 'application/pdf', //.pdf 'application/msword', //.doc 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', //.docx 'application/vnd.ms-excel', //.xls 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', //.xlsx 'application/vnd.ms-outlook', //.msg 'text/plain', //.txt, 'text/html' //.html ]; **// ts file** public uploader: FileUploader = new FileUploader({ ... allowedMimeType: this.lookup.allowedMimeType, ... }); everything else works fine except for .xls and .msg. **uploader.onWhenAddingFileFailed** is firing for files which have both of these extensions.
koenvanderlinden commented 2018-04-03 15:14:10 +00:00 (Migrated from github.com)

For a .xls file
I created a test Excel file using MS Excel 2013, saved the file as .xls (Excel 97-2003(*.xls)). Uploaded it. It passed the allowedMimeType filter you proviced in your comments. If I change the 'application/vnd.ms-excel', //.xls to something else. The file is filtered and uploader.onWhenAddingFileFailed is fired. Inspecting the FileLikeObject stated the (mime)type is 'application/vnd.ms-excel'.
So I didn't have a problem with the .xls file.

For a .msg file
When uploading a .msg file. The (mime)type is ''. So it's not possible to fix this with allowedMimeType. Problably have to add this via the allowedFileType. However .msg is not yet added to the ng2-upload-file code. I'll see if I can create a pull request for that.

**For a .xls file** I created a test Excel file using MS Excel 2013, saved the file as .xls (Excel 97-2003(*.xls)). Uploaded it. It passed the allowedMimeType filter you proviced in your comments. If I change the 'application/vnd.ms-excel', //.xls to something else. The file is filtered and uploader.onWhenAddingFileFailed is fired. Inspecting the FileLikeObject stated the (mime)type is 'application/vnd.ms-excel'. So I didn't have a problem with the .xls file. **For a .msg file** When uploading a .msg file. The (mime)type is ''. So it's not possible to fix this with allowedMimeType. Problably have to add this via the allowedFileType. However .msg is not yet added to the ng2-upload-file code. I'll see if I can create a pull request for that.
reddevilzee commented 2018-04-03 16:31:43 +00:00 (Migrated from github.com)

@koenvanderlinden Unfortunately, it doesn't allow me yet for .xls. When i upload a .xls file my fileLikeObject states an empty string. Wonder why?! I will try more unit test on this and update in this forum about my results.

I am in progress to create a pull request to allow the file types that I need in my project but not yet supported by this project.

@koenvanderlinden Unfortunately, it doesn't allow me yet for .xls. When i upload a .xls file my fileLikeObject states an empty string. Wonder why?! I will try more unit test on this and update in this forum about my results. I am in progress to create a pull request to allow the file types that I need in my project but not yet supported by this project.
koenvanderlinden commented 2018-04-04 05:59:54 +00:00 (Migrated from github.com)

@reddevilzee Do you have MS Office installed on the machine you are testing on? It's the machine that will need to tell the browser/file upload control what mime-type it is.

@reddevilzee Do you have MS Office installed on the machine you are testing on? It's the machine that will need to tell the browser/file upload control what mime-type it is.
Bombay2018 commented 2018-11-22 14:30:39 +00:00 (Migrated from github.com)

any updation for supporting .msg file

any updation for supporting .msg file
sashanth654 commented 2020-01-14 22:08:51 +00:00 (Migrated from github.com)

Would like to use this to upload .msg. Wondering if the issue has been resolved

Would like to use this to upload .msg. Wondering if the issue has been resolved
roopeshkumar commented 2020-01-27 14:11:47 +00:00 (Migrated from github.com)

We are using ng2 file upload and it works perfectly fine with all ms-office related mime types except for .msg. Any work around / solution for .msg mime type? Appreciate your help.

We are using ng2 file upload and it works perfectly fine with all ms-office related mime types except for .msg. Any work around / solution for .msg mime type? Appreciate your help.
ksshafik commented 2020-08-16 06:08:31 +00:00 (Migrated from github.com)

Unable to upload .msg file. I have tried both ways: allowedMimeType and allowedFileType. Please suggest a solution.

@koenvanderlinden The approach using allowedFileType also not working.

Really appreciate any solution.

Unable to upload .msg file. I have tried both ways: _allowedMimeType_ and _allowedFileType_. Please suggest a solution. @koenvanderlinden The approach using _allowedFileType_ also not working. Really appreciate any solution.
nishchithas commented 2021-07-19 15:09:16 +00:00 (Migrated from github.com)

@karthick-manoharan @ksshafik is there any work around for this issue? are you able to upload file with .msg type?

@karthick-manoharan @ksshafik is there any work around for this issue? are you able to upload file with .msg type?
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: dc/ng2-file-upload#811