I'm using Express and I need to download a file from server. I can easily download it with just <a href="mylink"></a>
, but there is some query parameters, that I want to hide from user.
So now I'm trying to use jQuery.ajax that sending a request to Express (srv1) and then Express sending request with my parameters to the another server (srv2). Server responds me with 'Content-disposition' header and a file data. It's ok. And there is a question - can I use that file and respond with it to my initial ajax request?
The problem is, that even res.download()
with files (that already on my srv1) doesn't work. Express sets headers well, but no file is prompting to download. Maybe there is a probem in ajax?