1

I'm having a bit of trouble loading an XML file with ASP. This is the location of the XML file (it's a UNC url):

\\ilife104\teamdisk\Shared\Integration\System\dev\Data\prcImportFactSetFeeds\fileList.xml

And this is my code:

<% 
'load the XML file.. 
Option Explicit
Response.Buffer = True

Dim xml
Set xml = Server.CreateObject("Microsoft.XMLDOM")
xml.async = False
xml.load (Server.MapPath("\\ilife104\teamdisk\Shared\Integration\System\dev\Data\prcImportFactSetFeeds\fileList.xml"))

Dim name, retrieved 
name = xml.documentElement.childNodes(0).text
retrieved = xml.documentElement.childNodes(2).text

Set xml = Nothing
%>  

It gives the error:

Server.MapPath() error 'ASP 0174 : 80004005'

Invalid Path Character(s)

/ITWeb/Interfaces/je/index.asp, line 9

An invalid '/' or '\' was found in the Path parameter for the MapPath method. 

Does anybody know a solution?? Thanks in advance, James.

Joel Coehoorn
  • 399,467
  • 113
  • 570
  • 794

2 Answers2

4

Server.MapPath takes a page-relative path (eg, ../Images/Something.png) and returns a full path on disk.

Since you already have a file path, you should not call Server.MapPath at all.

SLaks
  • 868,454
  • 176
  • 1,908
  • 1,964
0

needs to be

\\\\servername\\folder\\folder\\whateverfileyouwant.ext

you have to escape the characters

rainhider
  • 49
  • 1
  • 4
  • 13