This repository was archived by the owner on Oct 18, 2018. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed
GroupDocs.Annotation for .NET/Controllers Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change 8
8
using Newtonsoft . Json . Serialization ;
9
9
using System ;
10
10
using System . Collections . Generic ;
11
+ using System . IO ;
11
12
using System . Linq ;
12
13
using System . Web ;
13
14
using System . Web . Mvc ;
@@ -29,10 +30,8 @@ public ActionResult Post(string file)
29
30
Document doc = documentDataHandler . GetDocument ( filename ) ;
30
31
long documentId = doc != null ? doc . Id : imageHandler . CreateDocument ( filename ) ;
31
32
32
- //StreamReader stream = new StreamReader(Request.InputStream);
33
- //string x = stream.ReadToEnd(); // added to view content of input stream
34
-
35
- AnnotationInfo annotation = new AnnotationInfo ( ) ; //Request.InputStream as AnnotationInfo;
33
+ Request . InputStream . Seek ( 0 , SeekOrigin . Begin ) ;
34
+ AnnotationInfo annotation = new JsonSerializer ( ) . Deserialize < AnnotationInfo > ( new JsonTextReader ( new StreamReader ( Request . InputStream ) ) ) ;
36
35
annotation . DocumentGuid = documentId ;
37
36
CreateAnnotationResult result = imageHandler . CreateAnnotation ( annotation ) ;
38
37
return Content ( JsonConvert . SerializeObject (
@@ -43,4 +42,5 @@ public ActionResult Post(string file)
43
42
44
43
}
45
44
}
46
- }
45
+ }
46
+
You can’t perform that action at this time.
0 commit comments