@@ -30,7 +30,6 @@ public HttpResponseMessage Csv(int id)
3030 var filePath = System . Web . Hosting . HostingEnvironment . MapPath ( $ "~/bin/output/{ fileName } ") ;
3131 var fullPath = core . CasesToCsv ( id , null , null , filePath ,
3232 $ "{ core . GetHttpServerAddress ( ) } /" + "api/template-files/get-image/" ) ;
33- //$"{core.GetHttpServerAddress()}/" + "api/template-files/get-image?&filename=");
3433
3534 var result = new HttpResponseMessage ( HttpStatusCode . OK ) ;
3635 var fileStream = new FileStream ( fullPath , FileMode . Open , FileAccess . Read ) ;
@@ -47,7 +46,9 @@ public HttpResponseMessage Csv(int id)
4746 [ Route ( "api/template-files/get-image/{fileName}.{ext}" ) ]
4847 public HttpResponseMessage GetImage ( string fileName , string ext , string noCache = "noCache" )
4948 {
50- var filePath = HttpContext . Current . Server . MapPath ( $ "~/output/datafolder/picture/{ fileName } .{ ext } ") ;
49+ var core = _coreHelper . GetCore ( ) ;
50+
51+ var filePath = $ "{ core . GetPicturePath ( ) } \\ { fileName } .{ ext } ";
5152 if ( ! File . Exists ( filePath ) )
5253 {
5354 var resultNotFound = new HttpResponseMessage ( HttpStatusCode . NotFound ) ;
@@ -72,7 +73,9 @@ public HttpResponseMessage GetImage(string fileName, string ext, string noCache
7273 [ Route ( "api/template-files/rotate-image" ) ]
7374 public OperationResult RotateImage ( string fileName )
7475 {
75- var filePath = HttpContext . Current . Server . MapPath ( $ "~/output/datafolder/picture/{ fileName } ") ;
76+ var core = _coreHelper . GetCore ( ) ;
77+
78+ var filePath = $ "{ core . GetPicturePath ( ) } \\ { fileName } ";
7679 if ( ! File . Exists ( filePath ) )
7780 {
7881 return new OperationResult ( false , "File not found" ) ;
@@ -123,7 +126,9 @@ public OperationResult DeleteImage(string fileName, int fieldId, int uploadedObj
123126 [ Route ( "api/template-files/get-pdf-file" ) ]
124127 public HttpResponseMessage GetPdfFile ( string fileName )
125128 {
126- var filePath = HttpContext . Current . Server . MapPath ( $ "~/output/datafolder/pdf/{ fileName } .pdf") ;
129+ var core = _coreHelper . GetCore ( ) ;
130+
131+ var filePath = $ "{ core . GetPdfPath ( ) } \\ { fileName } .pdf";
127132 if ( ! File . Exists ( filePath ) )
128133 {
129134 return new HttpResponseMessage ( HttpStatusCode . NotFound ) ;
0 commit comments