Skip to main content
Question

Disable the option of selecting folders while using FilePicker.

  • May 22, 2025
  • 5 replies
  • 3 views

Forum|alt.badge.img

Hi, 

I am trying to use the filePicker for one of my ongoing projects and I am trying to find a way to disable the option of selecting folders. I am not able to find anything that might help me with this in the docs. It'll be great if anyone can help me out with this.

 

Also,  when I am trying to use ContentPicker instead of the FilePicker, for some reason I am getting a no-access error, even though I have all of the scope permission for my access token. It'll be great to get some help with that as well.

5 replies

Forum|alt.badge.img

Hey  - thanks for reaching out.

 

There are actually two different pickers - one for file selection and one for folder selection. You can see this by toggling the desired outcome in the sample HTML here.

 

Regarding the token permissions, are you able to make it work using your developer token? Is the application authorized to your enterprise?


Forum|alt.badge.img

No, I am not able to use it using my access token. For testing I am trying to use the codepen examples of content picker (by changing the access token to that of mine, and the root folder to '0'), but If I am trying to use the token with curl, I am able to get all of my files.


Forum|alt.badge.img

 have you added the domains in your whitelisted CORS? - https://developer.box.com/docs/box-content-picker#section-cross-origin-resource-sharing


Forum|alt.badge.img

 Yes, I have added the domain to CORS. But I am working on my local host(The domain that I have added to the CORS is of my localhost), do you think that might be a problem? 


Forum|alt.badge.img

 In your CORS, can you please add https: in addition to http: for port 3267? Or, can you try using port 8080 instead?