使用:asp .net mvc 4.0、c#、vs10
strFilePath保存目录中现有文件的路径。我想将文件保存/复制到我的应用程序的上传目录中。
我怎么能这样做。我正在尝试一些愚蠢的事情,并在互联网上搜索并感到无助。
string filePath = "foo.txt";
//var path = Path.Combine(Server.MapPath("~/Uploads"), filePath);
if (System.IO.File.Exists(filePath))
{
System.IO.File.Copy(filePath, "~/Uploads");
}