I have a route on my server that is used to serve files for download. Because of the nature of the app I cannot have a link to any file. Instead the browser client requests the file to the server which in turn request the file from a node client which returns the data back to the server. At this point the server saves the file and notifies the caller browser of the file being ready for request. Im using angular in the front end and to request the file I was trying to use $http.get()
, with that in chrome's dev tools I could see the request happening successfully but the file would not download. Typing the link address outside of angular would download the file. In turn I ended up using$window.location.assign(url)
and that did work. Could anyone explain why assign()
worked and not $http.get()
? What are the differences?
Thanks