I have two actions and I want to send HttpPostedFile from first action to another action using session or tempdata. who can help realize it this is my code, exeption in xdocument load - IIs Express/*.xml don't found
[HttpPost]
public ActionResult Index(HttpPostedFileBase fil)
{
if (fil != null && fil.ContentLength > 0)
{
Session["doc2"] = fil;
}
return RedirectToAction("Xmlview");
}
[HttpGet]
public ActionResult Xmlview()
{
HttpPostedFileBase file2= Session["doc2"] as HttpPostedFileBase;
var fileex = Path.GetExtension(file2.FileName);
var fileName = Path.GetFullPath(file2.FileName);
string xmlstr = ".xml";
Value model2 = new Value();
string strall = "";
if (fileex.Contains(xmlstr))
{
XDocument xml = XDocument.Load(fileName); // exeption hear IIs Express/*.xml don't found
var allElements = xml.Elements();
}