0

the file has read permissions for my domain

enter image description here

but when embedding the file on my google website reject the embed

enter image description here

code of iframe

 <iframe src="https://drive.google.com/file/d/172YjAlA4ZtXzaaHGXORRX-687k78Rsra/preview" width="640" height="480"> 
I appreciate any help, and if you ask me why I want to show a private file on my website, it is because there is a login through which I only let my users enter
3
  • 1
    What is the data that you need to show? How many files do you need to show? If its simple then there are some workarounds, but if you are talking about many files then you may require a server to make calls to the API and then serve the data in another format. Commented Apr 8, 2021 at 11:31
  • Thanks bro for answering, if there are many files and they are going to be uploaded constantly, can you explain your solution a little more Commented Apr 8, 2021 at 19:28
  • 1
    You would need your own server I believe. Again it depends a lot on what you are trying to do exactly, which you haven't given very many details. Though I believe the answer to your specific question is below so you should accept it. You cannot embed a private file. If you have another question you should open a new question. Though maybe softwareengineering.stackexchange.com is a better place for general questions about how to design your site. Commented Apr 9, 2021 at 7:09

1 Answer 1

2

YOu can not embed a private google drive on your website because in order to access that drive a user would need to have permission to it.

You are probably using the webContentLink as the link you are trying to display there is also no way to send authorization in the form of an access token along with this link. THe user themself must have access to the file to be able to download it.

You could try creating a sharable link manually on the Google Drive website and use that link you can set that link to be valid for anyone with the link. But this will be a manual thing as far as i know you can not create these types of links though the website.

Sign up to request clarification or add additional context in comments.

1 Comment

Can you recommend another solution to me, for my project ?, the idea is to upload, view , documents but host them in some service as drive

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.