1

So far, I've built a PHP script that downloads to a remote server of mine a file from Internet, provinding its URL (I've used this piece of code to download to the server). Now I would like to upload the downloaded file on Google Drive using its API.

My question is: Is there a way to download the file directly to Google Drive, without using the server? Or I am forced to download the file first to the server and then upload it to Google Drive?

Thank you

Community
  • 1
  • 1
Floppy88
  • 1,031
  • 3
  • 13
  • 31
  • There is an API Doc: https://developers.google.com/drive/v2/reference/files/insert and I don't think so. – dualed Aug 04 '12 at 15:21

2 Answers2

0

I doubt if you can 'make' google drive get file from an external location...

However you do have an option to create a shortcut to the external file, if that suits you.

Also, If you wish continue direct upload you may refer this.

loxxy
  • 12,990
  • 2
  • 25
  • 56
0

As far as I know the API doesn't allow to push files from another referer than the one that's calling the API. So, long story short:

First you need to download the file to your server, then upload it to gDrive from your server.

Read here more: https://developers.google.com/drive/examples/php#saving_files

Or here: https://developers.google.com/drive/manage-uploads

JarroVGIT
  • 4,291
  • 1
  • 17
  • 29