Skip to content
This repository has been archived by the owner on Oct 18, 2018. It is now read-only.

Commit

Permalink
Fix error when annotation is added
Browse files Browse the repository at this point in the history
  • Loading branch information
saqibmasood committed Apr 11, 2018
1 parent ef0dbb7 commit 06b0664
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
using Newtonsoft.Json.Serialization;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Web;
using System.Web.Mvc;
Expand All @@ -29,10 +30,8 @@ public ActionResult Post(string file)
Document doc = documentDataHandler.GetDocument(filename);
long documentId = doc != null ? doc.Id : imageHandler.CreateDocument(filename);

//StreamReader stream = new StreamReader(Request.InputStream);
//string x = stream.ReadToEnd(); // added to view content of input stream

AnnotationInfo annotation = new AnnotationInfo(); //Request.InputStream as AnnotationInfo;
Request.InputStream.Seek(0, SeekOrigin.Begin);
AnnotationInfo annotation = new JsonSerializer().Deserialize<AnnotationInfo>(new JsonTextReader(new StreamReader(Request.InputStream)));
annotation.DocumentGuid = documentId;
CreateAnnotationResult result = imageHandler.CreateAnnotation(annotation);
return Content(JsonConvert.SerializeObject(
Expand All @@ -43,4 +42,5 @@ public ActionResult Post(string file)

}
}
}
}

0 comments on commit 06b0664

Please sign in to comment.