Where is the path given for Request.AppRelativeCurrentExecutionFilePath

I need to know the path for Request.AppRelativeCurrentExecutionFilePath

. It gives the wrong file path when I receive any requests.

-1


source to share


1 answer


it gets the virtual path of the application root and makes it relative using the tilde (~) notation for the application root.

so if your app is hosted at http: // localhost / WebApp1 and you want to access Picture1.jpg in the root using this return ~ / picture1.jpg



string _directoryName = Request.AppRelativeCurrentExecutionFilePath + "Picture1.jpg" will return http: //localhost/WebApp1/Picture1.jpg

0


source







All Articles