I'm using S3 to host my user's documents. My s3 bucket is not publically accessible. So my current implementation for that is,
- When the user presses download, make an API call from my application to S3 and get the file to
/tmp/
on my server. - Send the file from
/tmp/
to the user's client as a browser download.
There is also a way to avoid saving to the server and directly sending the file to the client according to this question.
Which is the best practice? What are the disadvantages of sending a file object directly to the user?