Google Drive Picker: Show Images/Docs which have Link Sharing as ON

244 views Asked by At

I need to implement Drive Picker in my project which I have implemented correctly.

I need to show in the picker only those images/Docs which have the LinkSharing as 'ON'.By doing so, I can download the Images in my Project.

Here is my code for Picker:

_showPicker: function () {
        var accessToken = gapi.auth.getToken().access_token;          

            this.picker = new google.picker.PickerBuilder().
            addView(google.picker.ViewId.DOCS).
            enableFeature(google.picker.Feature.MULTISELECT_ENABLED).
            setAppId(this.clientId).
            setOAuthToken(accessToken).
            setCallback(this._pickerCallback.bind(this)).
            build().
            setVisible(true);
        }

This shows all the Docs/Images in the Picker. I need to show only those which have LinkSharing as 'ON'.

Any help is appreciated.

Thanks.

1

There are 1 answers

0
Andy On

Even with Link Sharing OFF, users can still download the files, assuming it has been shared with the proper permissions. Link Sharing is simply another means of sharing files by passing around URLs, rather than having to explicitly add a user. If it's only for downloading files, anything that you see in the picker views should be shared with you or owned by you. View access alone is enough to download files unless labels.restricted has been explicitly set. So you should be able to download those files without having to check for link sharing.