Search code examples
javascriptphpgoogle-drive-apidrive

How to generate direct download link for google drive shared link by file id


I want to generate google drive direct download link without opening web page.

I have found 1 site which do same thing but I did not find how he is doing.

below is the site which generates direct download link without opening google drive page.

https://links-safety.com/download.php?id=0B475ByfcR9n4a1JMVEZxQno2Tmc

0B475ByfcR9n4a1JMVEZxQno2Tmc is google file and replace with any file.

can anyone tell me how can I do that?I want to make same page like above site.

I tried this url but its not working. instead of starting download it opens page.

https://drive.google.com/uc?id=0BwSYfbOPSw89Rno4LTZpSGF6RUE


Solution

  • you have do something along this lines ..

    it is documented on Google API page, here: https://developers.google.com/drive/v3/web/manage-downloads#downloading_a_file