I am kinda newbie to this so I got not idea. Explanation:
I got an web app (front end made in JavaScript/Reactjs) and an backend (with Java using Liferay API)
Server has files (File A, B, C, etc. Any kind of file: pdf, excel, audio, txt, etc) these files are in a different location from the backend.
Each file has its own “ID” when I called the file from the java backend, I called like this: https://url-server.com?id=123456789 this automatically triggers a download. The URL is protected with an authentication method. I do not have access to this server with the files. I can only use this endpoint with ID as parameter.
The goal: streaming this file directly to the user (such as https://web-app.com/anotherNameForFile.txt obviously is just mapping the url from the original server with different name file) to the browser, so the user can “see” or use the file in the browser, but not be able to download the file to the PC. Kinda like Spotify or Netflix does. The file will still be kept in the server, streamed to the user and without option to download or copy the file the user is seeing in the app/browser.
Questions: How to do this? What would be the best approach? How to do the streaming and how to do it without the user be able to save the file? Any comments or even code example would be much appreciated.