public Stream GetResourceDataBytes(string scope, string app) { byte[] data = _adapterProvider.GetResourceDataBytes(scope, app); if (data != null) { MemoryStream stream = new MemoryStream(data); WebOperationContext.Current.OutgoingResponse.ContentType = "application/x-msaccess"; //or whatever your mime type is stream.Position = 0; return(stream); } else { return(new MemoryStream()); } }