question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

MS Outlook .msg file not uploading properly

See original GitHub issue

This has been posted elsewhere, but I have yet to see any solution or response for a full resolution. The “application/vnd.ms-outlook” filetype with the “.msg” extension can’t be properly uploaded right now with FilePond as far as I can see.

The lack of proper support means when clicking Browse to select a file to upload, the .msg files will always be grayed out. The only workaround is to drag the .msg file into the upload section and run the following code:

<FilePond
    ref={ref => (this.pond = ref)}
    files={null}
    allowMultiple={true}
    allowRevert={false}
    maxFiles={5}
    allowFileSizeValidation
    maxFileSize={'5MB'}
    // allowFileTypeValidation
    allowFileEncode
    acceptedFileTypes={[
        'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
        'application/msword',
        'application/pdf',
        'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
        'application/vnd.ms-excel',
        'application/vnd.ms-outlook'
    ]}
    fileValidateTypeDetectType={(source, type) =>
        new Promise((resolve, reject) => {
            if (source.name.includes('msg')) {
                type = 'application/vnd.ms-outlook';
                resolve(type);
            }
        })
    }
    fileValidateTypeLabelExpectedTypesMap={{
        'application/vnd.openxmlformats-officedocument.wordprocessingml.document':
            '.docx',
        'application/msword': '.doc',
        'application/pdf': '.pdf',
        'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet':
            '.xlsx',
        'application/vnd.ms-excel': '.xls',
        'application/vnd.ms-outlook': '.msg"'
    }}
    labelIdle={
        '<span class="filepond--label-action">Browse</span><br>Files must be under 5MB each and in one of the following formats: .doc, .docx, .xls, .xlsx, .pdf, .msg'
    }
    server={{
        url: this.state.baseUrl,
        process: {
            url: '[OMITTED FOR CODE SNIPPET]',
            method: 'POST',
            headers: {
                [OMITTED FOR CODE SNIPPET]
            },
            onload: res => {
                [OMITTED FOR CODE SNIPPET];
            }
        }
    }}
/>

This allows me to upload the .msg file but all the metadata is lost, and the title of the file won’t show up when it’s added to the list of files.

The most I’ve seen is people saying “use fileValidateTypeDetectType” but none of those posts have provided an explanation on how to use that to solve all of these issues. (I’ve used it in some capacity, but it’s not a fix for everything.)

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
bmalin92commented, Jun 9, 2020

Thanks for the update! This allows me to add the file through the Browse capabilities. Unfortunately uploading .msg files still prevents the data on the .msg from appearing on the item once uploaded. Basically, any other file I upload, the title of the file will appear as the title in the uploaded item. The .msg will just be blank. Am I not writing this correctly?

fileValidateTypeDetectType={(source, type) =>
   new Promise((resolve, reject) => {
       if (source.name.includes('msg')) {
           type = 'application/vnd.ms-outlook';
           resolve(type);
       }
   })
}
0reactions
rikschenninkcommented, Jun 12, 2020

See: https://pqina.nl/filepond/docs/patterns/plugins/file-validate-type/#custom-type-detection

It’s probably that the system uses a different type and so setting the type synced to the accept attribute doesn’t match the system type and the files cannot be selected. If you can find out what type the system uses it might work.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Fix MSG File Not Opening Problem in Outlook
Here you will learn 7 effective solutions on how to repair MSG file not opening problem in Outlook. Read more and fix the...
Read more >
Fix problems importing an Outlook .pst file - Microsoft Support
The most likely cause is that the contacts and calendar weren't exported to the .pst file. Try exporting your info to another .pst...
Read more >
10 Best Ways to Fix Cannot Open MSG Files With Outlook on ...
1. Open MSG File With Same Outlook Version · 2. Open Manually · 3. Set Default App · 4. Disable 3rd Party Antivirus...
Read more >
Repairing Corrupted MSG File (Self-Upload) - Lexbe Help
This technical note describes how to repair MSGs before upload to a case in the Lexbe eDiscovery Platform (LEP). This includes how to...
Read more >
Outlook not displaying .msg files correctly - Stack Overflow
It looks like you get a document item with an MSG file as an attachment. This is exactly what you would get if...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found