In the end, I did this:
WebApi method:
[HttpGet] public string GetFilePath(string fileName, Guid categoryId, Guid userId) { using (var _client = new DataServiceClient("epData")) { if (Properties.Settings.Default.Domain != "") { _client.ClientCredentials.Windows.ClientCredential.UserName = Properties.Settings.Default.Domain + "\\" + Properties.Settings.Default.Login; _client.ClientCredentials.Windows.ClientCredential.Password = Properties.Settings.Default.Password; } _client.SetCurrentUser(userId); var category = _client.GetAttachmentCategory(categoryId); LocalFileManager.SetWorkingFolder(category); } var serverName = HttpContext.Current.Request.Url.GetLeftPart(UriPartial.Authority) + HttpContext.Current.Request.ApplicationPath; var result = Path.Combine(serverName, LocalFileManager.shortWorkingFolder, fileName); return result; }
Ie, the GetFilePath method simply returns the url path to the file on the server.
And then through Angularjs, everything as shown in this example (just copy / paste): https://stackoverflow.com/questions/24080018/download-file-from-an-asp-net-web-api-method-using-angularjs
In IE 11 it also works as it should, if done as shown in Internet Explorer 11 Support (Fixed).