Saving an uploaded file with HttpPostedFileBase.SaveAs in a physical path

后端 未结 2 792
温柔的废话
温柔的废话 2021-01-01 18:10

I\'d like to save an uploaded file to a physical path by the method HttpPostedFileBase.SaveAs().

When I choose a physical path, an exception appears ind

2条回答
  •  醉梦人生
    2021-01-01 18:48

    Server.MapPath is for virtual path. You can try to use Path.GetFullPath(path).

提交回复
热议问题