1

I'm using filesGetTemporaryLink from the Dropbox API to get get a link to download a file. I save the link returned from this method to my db. It works for the most part but seemingly randomly I get a 410 error.

I'm wondering if these links are no longer accessible after a certain amount of time (I guess that could be expected from the name but I couldn't find another method to get a dl link). Should I be using something other than filesGetTemporaryLink to get a link I can save to my db?

Thanks!

maxwellgover
  • 6,661
  • 9
  • 37
  • 63

1 Answers1

2

The links returned by filesGetTemporaryLink do expire after four hours, at which point you will get that 410 error when trying to access them.

If you need a link that doesn't expire by default, you can use sharingCreateSharedLinkWithSettings instead, and modify the resulting link as documented here. Note that those links do get listed in the user's links list though.

If you can avoid the need to have a link, you can instead download the file data using filesDownload, which would be preferable.

Greg
  • 16,359
  • 2
  • 34
  • 44
  • I'm using `filesDownload` and I'm getting back a file in a form of a buffer array. My concern is that in case a file is too big, it can have a negative impact on a server load and performance. Could you please have a look on my question on this subject: https://stackoverflow.com/q/62740008 – Mike Jul 09 '20 at 07:22