error: "...is a physical path"

  • Thread starter Michiel Schaeverbeke
  • Start date
M

Michiel Schaeverbeke

Hi,

I'm trying to reach an xml file from within a web application. The file is
physically on a different server. When I try to reach it using
\\servername\path\ style, I get the error "\\servername\path\ is a physical
path". Using a virtual directory gives the same result.

All I really do is the following:

// XmlTransformer is a System.Web.UI.WebControls.Xml object
XmlTransformer.DocumentSource=this.MapPath("\\servername\path\filename.xml")
;

Does anybody have an idea how this can be solved? Thanks in advance!

Michiel.
 
K

Kevin Spencer

Not sure what "this" is supposed to be, but the HttpUtility.MapPath() method
expects a URL, and you're passing a physical path to it. Since the method
returns a physical path, you can go ahead and use the physical (network)
path without doing any transformation.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.
 

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

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top