Fix Office Web Viewer Not Opening DOCX or PPTX from Amazon S3
Question details
The user needs to resolve an issue where the Microsoft Office Web Viewer successfully displays XLSX files but fails to render DOCX and PPTX files hosted on Amazon S3 via presigned URLs.

- Product
- Microsoft Office Web Viewer / Amazon S3
- Device & OS
- not provided
- Scenario
- Embedding Office document previews in a web page using Microsoft's web viewer combined with S3 presigned URLs.
- Observed behavior
- XLSX files render correctly in the viewer, but DOCX and PPTX files fail to display, often due to URL parsing, encoding, or permission issues.
Verify that your Amazon S3 bucket permissions allow the files to be publicly reachable for the duration of the presigned URL, and ensure the original files are not corrupted by downloading and opening them locally.
Properly URL-Encode the Presigned S3 URL
Use this solution to ensure Microsoft's servers can correctly parse the complex query parameters included in an Amazon S3 presigned URL without cutting them off.
Amazon S3 presigned URLs contain multiple complex query parameters, such as access keys, signatures, and expiration timestamps. If these are not strictly URL-encoded before being passed to the Office Web Viewer, the viewer may truncate the URL, leading to rendering failures specifically for more complex formats like DOCX and PPTX.
Create your presigned URL in your backend application or AWS console as you normally would, ensuring the file path is correct.
Encode the entire presigned URL exactly once. If using JavaScript, apply encodeURIComponent(your_s3_url) before passing it to the viewer.
Pass the properly encoded URL to the viewer's source parameter like this: https://view.officeapps.live.com/op/embed.aspx?src=[ENCODED_URL].

Verify S3 Content-Type Headers and Expiration Times
Check this if the viewer still fails, as incorrect MIME types or short expiration times will block Microsoft from fully processing the document.
View and Edit Office Documents Seamlessly with WPS Office
If you frequently encounter compatibility or server-side rendering issues with online viewers, consider using WPS Office. It provides a lightweight, highly compatible, and free alternative to Microsoft Office for opening, editing, and managing your documents across all platforms.
- 1. Download WPS Office: Visit the official WPS Office website and click the free download button for your operating system.
- 2. Install the Software: Run the setup file and follow the quick installation prompts to set up the software.
- 3. Open Your Files: Launch the application and drag-and-drop your DOCX, PPTX, or XLSX files into the workspace to view or edit them.

Frequently Asked Questions
Why does Office Web Viewer open XLSX files but fail on DOCX or PPTX?
DOCX and PPTX files often require the web viewer to process more complex XML structures and linked resources compared to lightweight spreadsheets. If the S3 URL is improperly encoded or missing correct content-type headers, the viewer may fail on these heavier formats while simpler XLSX files manage to load successfully.
How long should a presigned S3 URL be valid for the Office Viewer?
A presigned URL should remain valid for at least 15 to 30 minutes. Microsoft's remote servers must have enough time to request, download, and initiate the rendering of the document from your S3 bucket before the signature expires.
Does Office Web Viewer support authenticated or restricted S3 URLs?
No. The view.officeapps.live.com service requires the target document URL to be entirely public and accessible without session cookies. Any login redirects or authentication prompts will permanently block the viewer from accessing the document.




