I remember we could select a folder on oneDrive file picker and then download the folder, but now it seems the folder cannot be selected. Is this a function as design?
@benjaminliugang which picker version are you using?
I still use v5.0 in our product, it should be support folder download, but it doesn't work right now. And I also tried with v7.0, it seems the folder cannot selected and download too, it there any settings I need to config, or it's just does not support?
For 7.0, we do not support folder download. You can save a file or query a folder's metadata. For 5.0, I didn't find the documentation about this feature on MSDN https://msdn.microsoft.com/en-us/library/hh826531.aspx. Would you mind directing me to the documentation page?
Hi @daboxu , at the beginning when we choose a folder, the response data format will show as follow link:
https://msdn.microsoft.com/en-us/library/jj219328.aspx#json
close this thread as we do not support folder download in picker SDK v6 and v7, while a work around for OneDrive Consumer only is generating sharing link for the folder and you have a link to share the folder.
Hey @daboxu,
As this functionality is no longer supported, can you please explain me the best practice for our use case?
[client side]聽The user chooses a folder from one of their cloud storages (OneDrive in this case).
[server side] We import files from this directory and register a webhook to get notified about changes.
We do not need the folder download functionality you describe above, but the user should be able to select a folder with the picker.
Is this somehow possible? Otherwise we would have to implement a custom OneDrive picker ourself.
Thanks for your help.
hi @jonas-arkulpa definitely the picker supports it, in v7.0 you can set action = "query" to get the identifier of the folder back: https://dev.onedrive.com/sdk/js-v7/js-picker-save.htm#parameters
OneDrive.save({action: "query"});
Hey @daboxu,
thanks for the quick response.
Your suggested solution works to get the folder id but has multiple drawbacks.
We allow our users to select one or multiple files (PDFs) or folders, which we import for them.
With the OneDrive 'save' picker it is only possible to select one folder at a time (also no files).
Also it is misleading for the user that the action button is labeled 'save' and not 'choose' or 'open'.
Isn't it possible to allow folder selection with the OneDrive 'open' picker?
Due to the following sentence on the open picker page I assumed this should work:
"...after the user selects a file or folder"
@jonas-arkulpa thanks for the feedback, actually we have a backlog about improving the folder select experience but unfortunately current picker only supports file select and folder select separately. Really sorry about that.
@daboxu
Thanks for the information, thats unfortunate.
Do you have an estimated time of building this functionality?
@jonas-arkulpa sorry I don't have an estimation on this work item. I haven't found a user voice page for this, so it would be nice if you could add one and we will re-estimate the priority based on the feedback. We need to keep compatibility and unity of picker UI experience on different picker SDK versions so It will involve lots of changes in the picker behavior. Thanks again for your patience and I am really sorry we cannot support your current story.
Hello @daboxu
I cant see a way to pick a folder. While it is possible to pick files, I cant select a folder. Are you sure that it is possible to set action=query and select a folder?
Thanks
Henk
I couldn't pick a folder either and it was because I was using OneDrive.open(odOptions); to open the file picker instead ofOneDrive.save(odOptions);. When I used.save()` it asked for more permissions and I was able to pick folders
I couldn't pick a folder either and it was because I was using
OneDrive.open(odOptions); to open the file picker instead ofOneDrive.save(odOptions);. When I used.save()` it asked for more permissions and I was able to pick folders
I've confirmed this as a limitation with the OneDrive File Picker when using open i.e. "query" mode. We are working on a release which allows this to be configurable. This way, you can select folder(s) without requiring elevated scope permissions.
I will follow-up once we've published a release with the updated bits.
Edit: we have the patch in review and are planning to publish shortly after the holidays cc: @jokr
This should be supported once the CDN cache expires for the File Picker scripts.
I've confirmed locally using the unminified "debug" script file served from https://js.live.net/v7.2/OneDrive.debug.js
Here is an example which scopes File Picker selection to _only_ folders using viewType. The typing of viewType is files | folders | all with a default value of files.
var options = {
clientId: '<client_id>',
viewType: 'folders',
success: (folder) => console.log('success', folder)
};
OneDrive.open(options);
We've published updated documentation for the viewType parameter at https://docs.microsoft.com/en-us/onedrive/developer/controls/file-pickers/js-v72/open-file?view=odsp-graph-online#parameters.
cc: @jokr
I've confirmed that the viewType parameter is now supported using the minified script (https://js.live.net/v7.2/OneDrive.js). Going to close this issue as since you can now select folder(s) in query mode by using this parameter.
Hello @KevinTCoughlin
Using the advanced option filter like this filter: "folder,.docx" with viewType: "folders" as you describe creates a picker that shows folders and .docx files but nothing is selectable. The Open button is always grayed out.
Removing the filter results in a dialog that only shows folders that are now selectable.
We need the ability to see what files are in a folder while also only being able to select folders. The filter option makes the dialog useless as you are unable to select anything. Is there a way to achieve this functionality?
Current options:
var options = {
clientId: '<client_id>',
action: "query",
multiSelect: false,
viewType: "folders",
advanced: {
redirectUri: '<redirect-uri>',
filter: "folder,.docx",
navigation: {
sourceTypes: ["OneDrive", "Sites"]
}
},
success: (folder) => console.log('success', folder)
};
Most helpful comment
This should be supported once the CDN cache expires for the File Picker scripts.
I've confirmed locally using the unminified "debug" script file served from https://js.live.net/v7.2/OneDrive.debug.js
Here is an example which scopes File Picker selection to _only_ folders using
viewType. The typing ofviewTypeisfiles | folders | allwith a default value offiles.We've published updated documentation for the
viewTypeparameter at https://docs.microsoft.com/en-us/onedrive/developer/controls/file-pickers/js-v72/open-file?view=odsp-graph-online#parameters.cc: @jokr