public HttpResponseMessage parseCSV(csvUploadRequest request) { var path = ""; HttpResponseMessage response = new HttpResponseMessage(); csvUploadAdapter adp = new csvUploadAdapter(); var source = Path.Combine(HttpContext.Current.Server.MapPath("~/CSV/"), path); request.FilePath = Path.Combine(source, request.FileName); csvUploadResponse result = adp.ParseCSV(request); response = Request.CreateResponse(HttpStatusCode.OK, result); return response; }
public HttpResponseMessage downloadCsv(csvUploadRequest request) { var path = ""; var source = Path.Combine(HttpContext.Current.Server.MapPath("~/Downloads/"), path); request.FilePath = source; HttpResponseMessage response = new HttpResponseMessage(); csvUploadAdapter adp = new csvUploadAdapter(); string result = adp.DownloadCsv(request); csvUploadResponse res = adp.download(request,result); response = Request.CreateResponse(HttpStatusCode.OK, res); return response; }