ISP path to web site files contains IP address causing an error. Please help

K

keith

Running on localhost, the code,
'DirectoryInfo d = new
DirectoryInfo(System.Web.HttpContext.Current.Server.MapPath("~/Upload"));'
sets d to the value "c:\happyzoomer\upload"

When the application runs under a web hosting account, it sets d to:
'D:\websites\69.20.101.123\happyzoomer.com\Upload'. and throws the following
error: System.IO.DirectoryNotFoundException: Could not find a part of the
path 'D:\websites\69.20.101.123\happyzoomer.com\Upload'.

I think that the ip address in the path may be the cause of the error.
Either that or perhaps it is a permissions issue. I'm kind of new to web
hosting issues. Can someone suggest an alternate way of coding this?

Thanks,

Keith
 
G

Guest

Try some of the other provided path - mapping methods such as those on the
Request object , e.g., Request.PhysicalApplicationPath etc.
Some of these may give you actual physical directory paths. Otherwise, you
will still need to deal with permissions issues.
Peter
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,768
Messages
2,569,575
Members
45,051
Latest member
CarleyMcCr

Latest Threads

Top