I have a filepath I am getting through calling an API. I am sending this filepath to the API again to merge all files into one single file.
For reading a file in the API I am using HttpContext.Current.Request.Files
in my application, but this is not giving a count. Is there any possible way to do this? Reading a file through filePath without going through upload file functionality.
I am calling this API
return $ajax.post('/api/convert/applicationtemp/CollateDoc/' + appID + '/' + DocName + '/' + Password + '/' + pageType, filepath);
This is the ASP.Net code:
[Route("CollateDoc/{applicationID}/{pdfFileName}/{pdfPassword}/{pageSize}")]
public bool CollateDocumentAndSaveToNAS(string applicationID, string pdfFileName, string pdfPassword, string pageSize, string [] filepath)
{
var httpRequest = HttpContext.Current.Request;
var http = httpRequest.Files;
var path = Path.Combine(HttpContext.Current.Server.MapPath(filepath) + documentspath, applicationID.ToString());
string prefix = DateTime.UtcNow.ToString("yyyy-MM-dd-hh-mm-ss");
var isCollated = CollateDocInPDF.CollateAllDocumentAndConvertToPDF(httpRequest,path, prefix, pdfFileName, pdfPassword, pageSize);
return isCollated;
}
I am not getting any file count here after hitting the API.