Skip to main content

Can anyone suggest the latest way to  get shared file Download url? I got next js 13  with react 18 project . There is no JS SDK currently so  using CDN v21.0.0. I need to get picked file download url from the file picker window and send it to the Back End to be downloaded there and fetch it then from different endpoint to my project. Thanks.

Hi 

Have you looked at the events for the file picker? https://developer.box.com/guides/embed/ui-elements/picker/#events

When the user clicks the choose button on the file picker you can have a listener that will get an array of the chosen elements. From there you can either send the fileID to your backend and handle the dowlonad there or use the ‘authenticated_download_url’ attribute to get a direct download link (you need an access_token for this so you’d have to append ?access_token=YOUR_ACCESS_TOKEN. This url can be shared with another service for direct download

Hope this helps

Rgds

Peter Christensen, Platform Solutions Engineer, Box


Reply