Download large file with JavaScript and browser progress bar

I have a problem. I need to download file with javascript. The problem is that I need to send POST request with http headers, so I can’t use tag or approach with form. Also, I don’t want to use ajax request, because I need to download very large file and I want to be shown default browser download progress. Is there a way to solve it?

A potential solution might involve modifying the backend to receive headers as query parameters, though this approach isn’t ideal. Given that I have the ability to configure NGINX to my liking, I wonder if there’s a method to convert query parameters into HTTP headers on the NGINX side. Also, I know about FileSystemWritableFileStream, and it seems as the best way, but it does not shows download progress too