I upload an xml file through $.ajax post
as formdata to an mvc controller. Is it possible to parse the file without it being saved in some directory in the server.
My c# code is as below
[HttpPost]
public ActionResult VersionXML()
{
if (Request.Files.Count > 0)
{
var file = Request.Files[0];
/*--Can I exempt this if clause and do something for the parsing--*/
if (file != null && file.ContentLength > 0)
{
var fileName = Path.GetFileName(file.FileName);
var path = Path.Combine(Server.MapPath("~/Uploads/"), fileName);
file.SaveAs(path);
}
}
return RedirectToAction("Show_New_Content");
}