locked
File Upload Error - Enumeration yielded no results RRS feed

  • Question

  • User-1499457942 posted

    Hi

      I have below code but when i click upload it shows no file chosen . It returns file0.hasfile true

    if (file0.HasFile)
    {

    file0 = Request.QueryString["test"].ToString() + "_tmp"  + file0.FileName;
    file0.SaveAs(Server.MapPath("~") + "/test/" + test);
    }

    On file0 it goes in erro

    Thanks

    Wednesday, June 20, 2018 3:15 PM

Answers

  • User-1716253493 posted
    if (file0.HasFile)
    {
    
    string fn = Request.QueryString["test"].ToString() + "_tmp"  + file0.FileName;
    file0.SaveAs(Server.MapPath("~/test" + "\\" + fn);
    }

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, June 20, 2018 4:14 PM