Skip to main content
Question

How to get shared file Download url

  • August 22, 2024
  • 1 reply
  • 49 views

Forum|alt.badge.img

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.

1 reply

pchristensen Box
  • Senior Staff Platform Solutions Engineer
  • 17 replies
  • August 23, 2024

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


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings