Embed OneDrive for Business Images in HTML or Email
Question details
The user wants to embed images stored in OneDrive for Business or SharePoint in HTML or email.

- Product
- OneDrive for Business and SharePoint
- Device & OS
- not provided
- Scenario
- Use a JPG, PNG, or SVG stored in OneDrive for Business or SharePoint as the source of an HTML image.
- Observed behavior
- A standard sharing link does not directly display the image in an HTML image tag.
Check whether your organization permits the image to be shared with the intended audience. For email, identify the clients recipients use and plan to test the image in those clients.
Create a Base64 image data URI with Power Automate
Use this workaround to place image data directly in HTML when a OneDrive for Business sharing link cannot serve as an image source.
Data URI support varies across email clients. Some Outlook clients, including the iPhone app, may not display the image, and it may disappear in forwarded messages or replies.
In Power Automate, select Create and choose a flow with a trigger suited to your task, such as an instant cloud flow.
Add the OneDrive for Business or SharePoint Get file content action and select the image file or its identifier.
Add a Compose action and use an expression such as concat('data:image/png;base64,', base64(body('Get_file_content'))). Replace image/png with image/jpeg or image/svg+xml as appropriate, and use the actual action name if it differs.
In your HTML editor or email action's HTML view, insert the Compose output as the src of an img tag. Send a test and check it in the recipients' email clients, including a reply or forward.

Host the image at a direct HTTPS URL
Use a direct image URL when your organization allows the image to be hosted where intended recipients can access it.
Create Image-Rich Documents with WPS Office
WPS Office is a free, lightweight Office alternative with familiar editing tools and Microsoft Office format compatibility, making it easier to move existing files into WPS. It does not change how OneDrive for Business sharing links work in HTML or email.

Frequently Asked Questions
Why doesn't a OneDrive for Business sharing link work in an img tag?
A standard sharing link can lead to a sharing page or require authentication rather than returning the image file directly. OneDrive for Business does not provide the personal OneDrive embed feature for these images.
Can I embed a SharePoint image using Power Automate?
Yes. Add SharePoint's Get file content action to a flow, convert the content to Base64, and use it in a data URI in the image tag. Test the result in the browser or email clients that will display it.
Will a Base64 image display in every Outlook client?
No. Data URI support varies between Outlook clients, and the image may not appear in the iPhone app or in forwarded messages and replies. Send test messages to the clients your recipients use.
Can I use an SVG image in an HTML email?
SVG support varies across email clients. If an SVG does not display, try a PNG or JPG version and test the message again in the relevant clients.




