Issue
You’re trying to convert a .msg
email file to PDF, but the conversion either fails or the PDF doesn’t come out as expected.
Why This Happens
This issue usually happens because of how the .msg
file is uploaded or stored—especially if the file host alters the file type during download (as some platforms do).
How to Fix It
Option 1: Host your .msg
files in a cloud storage service that preserves file integrity.
We recommend using a reliable storage provider that does not alter files during download:
Amazon S3
Dropbox (with direct download link)
Microsoft OneDrive (with direct link)
Box.com
These services maintain the original file format and avoid issues caused by file-type detection or conversion (which can happen with platforms like Google Drive).
You can also upload files directly to PDF.co using the Upload File API to avoid compatibility problems.
Option 2: Use a presigned upload URL (PUT method) with the correct upload settings.
If you’re uploading the .msg
file using a presigned URL, it must be uploaded in binary format with the correct headers.
Solution:
Include the Content-Type: application/octet-stream
header when uploading the file.
Example CURL command:
curl --location --request PUT '<insert your presignedUrl>' \ --header 'Content-Type: application/octet-stream' \ --header 'x-api-key: {{x-api-key}}' \ --data-binary '@./sample.msg'
This ensures the file is treated as a raw binary stream, required for .msg
file compatibility.
Helpful Tips:
Always upload
.msg
files as complete files, not copied text or opened content.Avoid cloud storage providers that modify files during download.
Base64 encoding may help preserve file format during transfer if needed.