I am working on an ASP.net project and I have a file upload control. I have a folder in my solution called user_uploads. How can I modify the following code in order to save the files in user_uploads when I publish the solution?
string fn = System.IO.Path.GetFileName(FileUpload1.PostedFile.FileName);
FileUpload1.PostedFile.SaveAs("C:\\temp\\" + fn);
you just need to do as below get the path of the folder using MapPath and than use that path to save you file …