What are best practices for serving files from the FileSystem (S3 Bucket or Azure Blob) to a user?
/file/1/tenant/tag/url appears to partially work and so far may be the best option. However, we cannot find anything that could be used to secure that api, restricting it to specific users and specific file paths. It also opens the file in the browser window (content type ‘text/csv’) rather than downloading it, even when specifying the ‘download’ attribute to the anchor tag.
For small files, reading the file contents as either binary or string, and passing them back to browser as an API result for a client-side save-as works fine. However, many of these files are rather large (~100MB) so this does not seem like a good option for those.
The use case is as follows:
The application does monthly data processing to generate a large table of calculated values, which is displayed as part of the application. The business wants to save a snapshot of this table each month so its data scientist can download it and compare how the calculated results change over time. Saving a snapshot of the table to the FileSystem is complete and working fine, now we just need a way for the people who need it to get it.