Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

How to download shared file from Google Drive using a link?

For example we have a link to Google Drive: https://drive.google.com/file/d/1o4bqvKsGjf_yukzt-zQPtZWtqv21gpmv/view?usp=sharing

This file on someone’s drive, not on my own. And how to download this file using API, if I know only a link?

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

enter image description here

The share with me link that you can get via the google drive web application. is not a true form of sharing.

In order to download a file using the api you must first have permission to access that file. That being said you must have a record on the file with your username (email address) returned by a premissions.list call on the file.

Without it when you do a file.list the file will not show up as you do not have permissions on the file.

The issue with the share with me link is that the Id is not the id of the file. So even if the file was public you would not be able to find it.

To be clear a share with me link to a file on google drive does

  1. not contain the true file id needed for the api
  2. grant any true permissions on the file. meaning that you cant access it via the api.
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading