Fix OneDrive and drv.tw PDF Iframe Display Issues
Question details
Users need to resolve intermittent website loading failures and stop PDF files from automatically downloading when embedded in an iframe.

- Product
- OneDrive and drv.tw
- Device & OS
- macOS
- Scenario
- Hosting a static website and embedding PDF files within an iframe using OneDrive connected through the drv.tw hosting service.
- Observed behavior
- The website intermittently fails to load scripts or shows a page-not-found error, and embedded PDF files force a download or open in a new tab instead of displaying inline.
Verify that the drv.tw service is currently online, and check your browser's developer console for any immediate network or cross-origin errors before proceeding.
Migrate to a Dedicated Web Hosting Service
Switching to a standard hosting provider is necessary because drv.tw lacks the specific HTTP headers required for inline PDF display.
Services like drv.tw convert cloud storage files into web pages but often restrict or cannot configure HTTP response headers. Specifically, they fail to send the 'Content-Disposition: inline' header, which tells the browser to render the PDF inside the iframe rather than downloading it as an attachment.
Select a traditional static web hosting service such as GitHub Pages, Netlify, or Vercel, which support standard web protocols and proper file MIME types.
Transfer your HTML, CSS, JavaScript, and PDF files from your OneDrive folder to your new hosting environment or connected Git repository.
In your HTML code, locate the <iframe> tag and update the 'src' attribute to point to the new relative path of your PDF file on the new server.

Perform Basic Browser and Local Troubleshooting
Rule out local browser caching, extension conflicts, or corrupted local files that might prevent scripts and pages from loading correctly.
Manage and Edit PDFs Seamlessly with WPS Office
While web hosting limits can prevent online PDF embedding, managing your source documents shouldn't be a hassle. WPS Office offers a free, lightweight alternative to Microsoft Office, featuring a robust built-in PDF reader and editor that works flawlessly on your desktop.
- 1. Download and Install: Visit the official WPS website, download the installer for your operating system, and follow the on-screen prompts.
- 2. Open Your PDF: Launch WPS Office, click on 'Open', and select the PDF file you intend to upload to your website.
- 3. Edit and Save: Use the PDF toolkit to annotate, compress, or edit your document, then save it to your OneDrive folder for web publishing.

Frequently Asked Questions
Why do my embedded PDFs download instead of showing in the iframe?
This occurs because the hosting service (like drv.tw) sends a 'Content-Disposition: attachment' header instead of 'inline'. This forces modern browsers to download the file rather than rendering it inside the iframe.
Are the Google Analytics SameSite cookie warnings causing the PDF issue?
No, warnings in your developer console about the _ga_ cookie and SameSite attributes are standard notices from Google Tag Manager or Analytics. They do not affect how PDFs or iframes load.
Is drv.tw a reliable service for hosting websites?
While drv.tw is a convenient free tool for turning cloud storage into simple web pages, it often experiences downtime and lacks the server configuration options required for reliable media embedding and script loading.




