public IStream Download(Document entity) { if (WebOperationContext.Current != null) { WebOperationContext.Current.OutgoingResponse.Headers.Add("Access-Control-Allow-Origin", "*"); } var fileStream = ErpManager.DownloadDocument(entity); return(fileStream); }