I can create a new google.picker.PickerBuilder with specific files stored in my appdata folder, from google drive ?

I reached get all the files from my appdata folder in PHP, but I want to display them in a view like in this example:

   function createPicker() {
    var view = new google.picker.View(google.picker.ViewId.FOLDERS);
    var picker = new google.picker.PickerBuilder()
        .enableFeature(google.picker.Feature.NAV_HIDDEN)
        .addView(view)
        .setTitle("Select a Text File")
        .setCallback(pickerCallback).
        build();
    picker.setVisible(true);
}

// A simple callback implementation.
function pickerCallback(data) {
    if (data.action == google.picker.Action.PICKED) {
        var fileId = data.docs[0].id;
        alert('The user selected: ' + fileId);
    }
}
google.setOnLoadCallback(createPicker);
google.load('picker', '1');

Except this is load all my files from google drive and I want only the ones from my appdata folder.

Thanks a lot!

有帮助吗?

解决方案

The appdata folder is designed for files that are not visible to the user. Things like configuration files that it doesn't make sense for them to be able to see, edit or work with individually. They can just see the amount of storage being used.

If you want the user to be selecting specific files, it probably doesn't belong in the appdata folder. You could create a regular folder for your app, and set that as the starting point for the picker by calling "setParent" on the view with the id of the folder.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top