Why not? As it seems, JS is not doing anything that isn't do-able with a <a href="...file..." target="_blank"> - as soon as the browser gets a file that it cant render (.zip, ...), it will download it.
The magic is in the server, which must set the MIME type to application\octet-stream or something similar, so the browser doesnt try to render certain browser-rendable files (.htmls, .pdfs, ...)