Last post Jan 29, 2008 03:40 AM by Spider Master
Jan 28, 2008 01:32 PM|terryrey|LINK
I recently wrote a handler to obtain files from a directory on the same level as my website.
When trying to access the root path of the website I was using "..\" notation and this threw an error. I have subsequently overcome the problem but would like to find out if this is a permissable (not preferable because I have read why it shouldn't be used)
way of doing it. In other words, does ASP.NET/Win 2003 allow this method.
Jan 28, 2008 06:27 PM|Spider Master|LINK
Typically when I use handlers and modules I would fixed path naming such as
And I believe that localdrive..\ should be../ for a server mapped path
Jan 28, 2008 11:43 PM|terryrey|LINK
Thanks for the response. I worded the question quite poorly, so to clarify;
My problem was that I wanted to access a directory on the same level as the website e.g. dir structure on the host is c:\web\mysite.com, I was trying to access a dir called c:\web\NewDir
I have since used the full pathame and this works perfectly. Prior to that, I was trying to obtain the pathname by using Context.Server.MapPath("..\") This threw the error;
System.Web.HttpException: Cannot use a leading .. to exit above the top directory.
My question should have been, is Context.Server.MapPath("..\") a valid expression. It works perfectly on my development machine, Win XP ans IIS 5 but throws the error on Win 2003 and IIS 6 (with Parent Paths enabled)
Jan 29, 2008 03:13 AM|Spider Master|LINK
Excellent well you have one problem solved and I would think with your question being more specific to IIS when we are here as asp.net developers and may have an answer for you but most of us really dont need to have that much involvement with a server such
as IIS and you would be better to ask on the IIS site
http://www.iis.net/default.aspx?tabid=1 (note you can easily navigate between all community sites on the drop down menu at the top left of this screen)
Best of luck Terry [:D]
Jan 29, 2008 03:23 AM|terryrey|LINK
Thanks Spider Master, point well taken. I'll try the other forum you mentioned and will post back any answer I may get to here.
Jan 29, 2008 03:40 AM|Spider Master|LINK
No worries [:D]