Hi Nilam,
I did some search based on the mentioned context and found some of the pointers releated to it.
- The file.type attribute is returning blank in case of .msg file upload
- The issue/problem that the browser doesn't return correct mime-type for outlook-msg-files. Instead of
application/vnd.ms-outlook
the type-property of File
shows an empty string.
Reference links:
https://stackoverflow.com/questions/43915869/file-with-msg-extension-not-downloading
https://stackoverflow.com/questions/56137532/what-do-you-do-when-angularjs-fileuploader-returns-nothing-for-file-type
https://stackoverflow.com/questions/55687631/which-mime-type-can-i-use-for-msg-file-using-file-object
I could suggest you a work-around i.e. Using JavaScript, you can get the uploaded File type, referring to the file extesnion as mentioned-below.
JavaScript Snippet:
var control = document.querySelector("#" + $parameters.UploadWidgetId + " > input");
if (window.FileReader && window.Blob) {
// All the File APIs are supported.
control.addEventListener("change", function(event) {
// When the control has changed, there are new files
var files = control.files;
var i = 0, fileType = "";
if (files[i].name !== null && files[i].name !== undefined && files[i].name.endsWith(".msg")) {
fileType = "application/vnd.ms-outlook";
}
$actions.SetFileInfo(files[i].type || fileType, files[i].size);
}, false);
} else {
// File and Blob are not supported
}
See this sample screen UploadWidget_MSG Demo
Refer to the attached .oml file
Hope this helps you!
Kind regards,
Benjith Sam