File Uploading using Server.MapPath() and FileUpload.SaveAs()

前端 未结 4 1986
梦如初夏
梦如初夏 2021-02-09 09:51

I have a website admin section which I\'m busy working on, which has 4 FileUpload controls for specific purposes. I need to know that , when I use the Server.MapPath()

4条回答
  •  一生所求
    2021-02-09 10:24

    It's one line of code:

     FileUpload1.PostedFile.SaveAs(Server.MapPath(" ")+"\\YourImageDirectoryOnServer\\"+FileUpload1.FileName);
    

提交回复
热议问题