0

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

Aditi Parikh
  • 1,522
  • 3
  • 13
  • 34

1 Answers1

2

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

Kresimir Pendic
  • 3,597
  • 1
  • 21
  • 28
  • Thanks it is working. but above site is using other method. that site generate url like this https://doc-0o-a0-docs.googleusercontent.com and your method generates https://www.googleapis.com url. – Jimmy Lancstar Aug 04 '17 at 16:40
  • kresimir pendic can you tell me which php code used this site to generate link ?? https://links-safety.com/download.php?id=0B475ByfcR9n4a1JMVEZxQno2Tmc – Jimmy Lancstar Aug 05 '17 at 16:16
  • Or a simpler method without API keys, make a POST request. https://stackoverflow.com/a/47625446/661872 – Lawrence Cherone Dec 04 '17 at 02:27
  • this working but the file name is id of that file – Jazuly May 24 '18 at 12:50