I have ubuntu server with API and separate site developed with asp core 2. A user should be able to download a file, but an issue is that files can't be stored in wwwroot folder on API because of security reasons. If the user sends request to the site that then sends request to API and download the file stored in not wwwroot folder there is twice time to download it because firstly the site downloads the file and then the user. Now I use other way: firstly I send ajax request to API and receive file but the problem is that file downloading status is not displayed. It can be just watched at developer tools in network. So may be there is another solution?
Asked
Active
Viewed 58 times
0
-
" If the user sends request to the site that then sends request to API"...why can't the user directly send a request to the API? And I fail to see how the location of the files is relevant. The API should not expose the files directly for download anyway, there should be a "Download" action method which then causes the file to be fetched from a secure location and presented for download. That way the correct security can be easily applied on the request. P.S. You can't download files via AJAX, use a regular HTTP request. – ADyson Jun 12 '18 at 13:33
-
Possible duplicate of [File download from SFTP server on ASP.NET page](https://stackoverflow.com/questions/50851959/file-download-from-sftp-server-on-asp-net-page) – Martin Prikryl Jun 14 '18 at 08:17