public ActionResult DownLoad(Guid id) { FileStorageModel model; using (var service = new FileCollectorServiceClient()) { model = service.DownloadFile(id).Select(r => new FileStorageModel() { Id = r.Id, Name = r.Name, Path = r.Path, Type = r.Type, Size = r.Size, CreateDate = r.CreateDate.DateTime.ToShortDateString() + " : " + r.CreateDate.DateTime.ToShortTimeString(), LoadDate = r.LoadDate.DateTime.ToShortDateString() + " : " + r.LoadDate.DateTime.ToShortTimeString(), Data = r.Data }).Single(); } return(new FileContentResult(model.Data, "application/octet-stream") { FileDownloadName = model.Name }); }
public void DownloadFileTest() { try { using (var service = new FileCollectorServiceClient()) { var id = service.GetFiles().First().Id; var result = service.DownloadFile(id); } Assert.IsTrue(true); } catch (Exception e) { Assert.Fail(e.ToString()); } }