// GET: ArtefactInfo/Details/5 public async Task <ActionResult> Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } var request = new HTTPrequest(); ArtefactInfoDto artefactInfo = await request.Get <ArtefactInfoDto>("api/artefactInfo/" + id); if (artefactInfo == null) { return(HttpNotFound()); } //TODO review this works HttpResponseMessage bytesResponse = await request.GetResponseMessage("api/artefactInfo/" + id + "/bytes"); byte[] response = await bytesResponse.Content.ReadAsByteArrayAsync(); //sets bytes to actual byte response artefactInfo.File = response; return(View(artefactInfo)); }
public async Task <ActionResult> GetVideo() { var request = new HTTPrequest(); ArtefactInfoDto artefactInfo = await request.Get <ArtefactInfoDto>("api/artefactInfo/1"); if (artefactInfo == null) { return(HttpNotFound()); } HttpResponseMessage bytesResponse = await request.GetResponseMessage("api/artefactInfo/1/bytes"); byte[] response = await bytesResponse.Content.ReadAsByteArrayAsync(); return(File(response, "video/mp4")); }