andre487
andre487

Reputation: 1399

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?

Upvotes: 0

Views: 749

Answers (1)

Linda Lawton - DaImTo
Linda Lawton - DaImTo

Reputation: 116908

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.

Upvotes: 1

Related Questions