upload file to a folder outside site directory RRS feed

  • Question

  • User2108892867 posted

    Hello everyone, I am trying to upload file to folder outside my site directory. So for example, my site directory is www.example.com, I can save file to one of the directories like this: 

    AsyncFileUpload1.SaveAs(Server.MapPath("~/file/") + fileName); 

    That will save the file to www.example.com/file/myname.jpg. But because I usually replace my website files, I would love to store the file outside this website directory. Instead I want to store it in the root directory. The structure of my folders will be something like this



    file (this is where I want the file to be uploaded to)

    How can it be done? 


    Monday, August 24, 2020 4:55 AM