Skip to content
Advertisement

Is it possible to upload to root of sub-folders with Google picker?

We have a working google file picker but our users gets confused by having to select the folders and not being able to save in the root of the current folder they are at. Is there some option that can be used to change the behaviour of the picker so that is possible? Or maybe a different approach entirely?

This is a small snippet of the angular code that sets up the behaviour of the google picker:

    const pickerBuilder = new google.picker.PickerBuilder();

    view = new google.picker.DocsView()
      .setParent('root')
      .setIncludeFolders(true);
    view.setMimeTypes('application/vnd.google-apps.folder')
      .setSelectFolderEnabled(true);
    picker = pickerBuilder
      .enableFeature(google.picker.Feature.NAV_HIDDEN)
      .setOAuthToken(this.oauthToken.access_token)
      .addView(view)
      .addView(new google.picker.DocsUploadView());

Advertisement

Answer

Basically we ended up giving our users 2 options:

  • Save to root
  • Save to folder

not an optimal solution but it made it possible to save in the root AND by having the save text mention folder it would give the user a hint about how the regular save feature works.

User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement