I used lightning-file-upload to allow Users to upload files. Now, one of the use cases is, if the file is an email (.msg file type), we need to split the attachments and upload them as individual files. Tried using a custom file upload component, but could not get a way to read the attachments. Any ideas around how this can be achieved.
1 Answer
You can use lightning-input type="file"
to catch these files, and even upload them with lightning-ui-record-api via the createRecord
function. To understand how to read a .msg
file, you'll need Microsoft's [MS-OXMSG]: Outlook Item (.msg) File Format specification. You can use something like MSG Reader to read the contents of the file (note: I have not reviewed this software, you may need a different once). This is the core of everything you need, but some assembly is required.