Click here to Skip to main content
15,947,389 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am trying to upload file, But it is giving error as" Fake Path" not found. showing url: c:/fakepath/untitle.jpg" If i tried to add untitile.jpg to the c folder by creating a folder called fakepath then it is working fine. What will be the solution for this?

       public void ProcessRequest (HttpContext context) {
        string path = context.Request["path"];
        string filepath = Path.GetFileName(path);
        var file = context.Request.Files;
        
        FileInfo Fn = new FileInfo(path);
        //Fn.CopyTo(context.Server.MapPath("~/upload/"+Fn.Name));
        Fn.CopyTo(context.Server.MapPath("~/upload/"+filepath));
        //Fn.CopyTo(context.Server.MapPath("~/upload/"+file));
        
  }


I tried on IE by adding my site to trusted sites. Then it worked well it uploaded. But what is the problem with the other browsers?? How can i found solution?
Posted
Updated 26-Mar-14 23:12pm
v3

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900