不使用Server.Mappath接受UNC网址 [英] Server.MapPath not accepting UNC URL

查看:131
本文介绍了不使用Server.Mappath接受UNC网址的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一点麻烦装载与ASP的XML文件。
这是XML文件的位置(这是一个UNC网址):

<$p$p><$c$c>\\\\ilife104\\teamdisk\\Shared\\Integration\\System\\dev\\Data\\prcImportFactSetFeeds\\fileList.xml

这是我的code:

 &LT;%
加载XML文件..
显式的选项
将Response.Buffer = TRUE昏暗的XML
组XML =的Server.CreateObject(Microsoft.XMLDOM)
xml.async =假
与XML.load (Server.MapPath(\"\\\\ilife104\\teamdisk\\Shared\\Integration\\System\\dev\\Data\\prcImportFactSetFeeds\\fileList.xml\"))昏暗的姓名,检索
名称= xml.documentElement.childNodes(0)的.text
检索= xml.documentElement.childNodes(2)的.text组XML =无
%GT;

它给人的错误:

 使用Server.Mappath()错误'ASP 0174:80004005'路径无效字符(S)/ITWeb/Interfaces/je/index.asp,9号线无效的'/'或'\\'在MapPath方法的Path参数中。

有谁知道解决办法?
在此先感谢,詹姆斯。


解决方案

使用Server.Mappath 需要一个页面相对路径(例如, .. /Images/Something.png ),并返回磁盘上的完整路径。

既然你已经有一个文件路径,你不应该叫使用Server.Mappath 的。

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.

解决方案

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.

这篇关于不使用Server.Mappath接受UNC网址的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆