3
Reply

File Upload Path in ASP.NET hosted Application

Mark Tabor

Mark Tabor

May 29 2016 6:56 AM
297
I have a web application in which i am saving files into the directory placed onto the root folder of my application , it works fine locally but when i hosting the application into the hosting environment it is not saving my file , locally i have save a filePath into the web.config like that 
<add key="FilePath" value="~/Uploads/" />
 
and i was accessing it using that statement
Dim FilePath As String = ConfigurationManager.AppSettings("FilePath").ToString
 
How to achieve that on hosting server i have already tried
HttpContext.Current.Server.MapPath("~/Uploads/")
as well as
Server.MapPath("~/Uploads/") but it shows the local path address of my directory hierarchy .
 
 
 
Thanks in advance  

Answers (3)