Use the Content-Type
from Email Attachments: In your Logic App, make sure that you are using the correct property from the email attachment to set the Content-Type
when saving the file to Azure Storage. You should use the Content-Type
property of the email attachment to set the Content-Type
of the saved file.
Logic App Designer: When using the Logic App Designer, make sure that you set the Content-Type
of the Azure Blob Storage action based on the value of the Content-Type
property of the email attachment.
- Expressions: If you are using expressions in Logic Apps, you can use dynamic content to extract the
Content-Type
from the email attachment and use it in the Azure Blob Storage action. For example:
outputs('Compose')['attachments'][0]['contentType']
Here, outputs('Compose')
refers to the output of a previous action (like the "Compose" action that may extract attachments), and [0]
refers to the first attachment. Adjust the expressions based on your Logic App configuration.
Content-Disposition Header: If the Content-Type
is still not being preserved, you can also check if the email attachments have the Content-Disposition
header set correctly. This header can sometimes influence how the Content-Type
is interpreted.
Explicitly Set Content-Type
in Azure Blob Storage Action: As a last resort, you can explicitly set the Content-Type
in the Azure Blob Storage action using a constant value, but this might not preserve the original Content-Type
from the email attachment.