How to get the direct download link of a file by google drive api v3 in java

Hưng picture Hưng · Mar 7, 2016 · Viewed 8.4k times · Source

How to get the direct download link of a file by google drive api v3 in java ?

Hi all, I've worked with Google Drive Api in Android for a week, I used both Android Drive SDK and Drive Rest Api for java but I can't find the way how to how to get the direct download link of a file (anyone can read) on Drive. I've try How to get the url of a file of google drive to download in android but it's not work. Please help me. Thanks.

Answer

Michael Nyamande picture Michael Nyamande · Feb 22, 2018

Given that you have the actual FILE-ID for the file , you can download it using the download link

drive.google.com/uc?id=FILE-ID&export=download