I'm now trying to make a function that allows users to access to the link of the file to download.
The native link is https://www.dropbox.com/home/Apps/ringle_records?preview=lesson_id_11%3Auser_id_5.mp3 but, it is only accessible by admin ( for sure ). If I have a user who is eligible to know this link, then I would love to allow this user to click some button to download the file.
I am kind of bogged down when it comes to implementation. Because if I use the below code, it seems it stores data into the server.
contents, metadata = Drop_client.get_file_and_metadata('/lesson_id_12:user_id_7.mp3.mp3')
File.open('filename.mp3', 'wb') do |file|
If you only need to allow other users to download this specific file (or some specific set of files), the easiest way is to just get a shared link to the relevant file(s):
You can modify these shared links for different behaviors, e.g., for file downloads, as shown here:
If you do need to get these links programmatically, you can use the
You can then give the shared link to the user, e.g., as a link on a web page, or in an email, etc.