user765443
user765443

Reputation: 1892

iframe into blogspot not working

I am trying to insert pdf into blogger using iframe.But I am getting blank page Any idea How to fix it. I was getting blank page with chrome and firefox. I was getting error "This publisher does not allow to publish" in internet explorer

> <iframe width="100%" frameborder="0"
> src="https://drive.google.com/file/d/0B15mEFBok9BVUExXV2lRTDNsYjQ/view?usp=sharing"></iframe>

enter image description here

Upvotes: 0

Views: 961

Answers (1)

Alex Santos
Alex Santos

Reputation: 2950

It seems like Google Drive has the HTTP header X-Frame-Options set to SAMEORIGIN. That means that it can only be embedded within the same domain (drive.google.com). You can read more about it here: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Frame-Options

You should be able to see the error by opening your browser's console:

Refused to display 'https://drive.google.com/file/u/2/d/0B15mEFBok9BVUExXV2lRTDNsYjQ/view?usp=sharing' in a frame because it set 'X-Frame-Options' to 'SAMEORIGIN'.`

My recommendation is to host it somewhere else (e.g. Amazon S3), where you have control over the HTTP headers.

Upvotes: 1

Related Questions