Can Google Picker API be used to save file from a URL to Google Drive?

711 views Asked by At

I would like to create a website which enables users to save a web file to their Google Drive Account. User has to paste the URL of the file and upon submitting the file will be saved to user's Google Drive account. This website offers such a functionality (not necessarily from Picker API). I would like to replicate it. How it could be done?

1

There are 1 answers

1
Teyam On

Not necessarily the Google Picker API but you may want to try the Save to Drive Button feature of Google Drive API. This feature enables your web site to allow users to save files to their Drive account from an arbitrary URL via their browser. The button is configured with a few attributes in a div tag in the HTML markup, similar to how the +1 button is created.

The simplest way to display a Save to Drive button on your page is to include the necessary JavaScript resource and to add the Save to Drive button tag:

<script src="https://apis.google.com/js/platform.js" async defer></script>
<div class="g-savetodrive"
   data-src="//example.com/path/to/myfile.pdf"
   data-filename="My Statement.pdf"
   data-sitename="My Company Name">
</div>

For more detailed information and examples, please try going through the given link.

Hope that helps! Cheers!