This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Would be best to store this in ~/Scripts/durandal/plugins for convenience. | |
// This is so that when you must download a file from the web, via WebAPI with an OAuth2 token, you can validate yourself to the Api. | |
// This has been tested with small-ish files, but has not been tested with larger files, like installers. Please offer contributions | |
// back for those items. | |
define(["durandal/system", "durandal/app"], function (system, app) { | |
var defaults = { | |
url: "", // to be provided by end user. | |
method: "GET", | |
mimeType: "application/octet-stream", | |
filename: "download.bin", |