Server.MapPath error

the error:

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

Invalid Path Character(s)

/administration/stratplan/NewYorkTeam.asp, line 6

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

the code:

<%
set directory = Server.CreateObject("Scripting.FileSystemObject")
' line 6 below
set allfiles = directory.GetFolder(Server.MapPath("\serverfolder"))
%>

<%
For Each thing In allfiles.Files
%>
<%= thing.Name %>
<%
Next
%>

<%
filefound = nothing
directory = nothing
allfiles = nothing
%>

Whats wrong with my path? does vbscript not like \? if i cant do that, can i do it via asp/javascript? (i tried but i couldnt display the items...or find the path)

<3 steve.

Comments

  • : the error:
    :
    : Server.MapPath() error 'ASP 0174 : 80004005'
    :
    : Invalid Path Character(s)
    :
    : /administration/stratplan/NewYorkTeam.asp, line 6
    :
    : An invalid '/' or '' was found in the Path parameter for the MapPath method.
    :
    : the code:
    :
    : <%
    : set directory = Server.CreateObject("Scripting.FileSystemObject")
    : ' line 6 below
    : set allfiles = directory.GetFolder(Server.MapPath("\serverfolder"))
    : %>
    :
    : <%
    : For Each thing In allfiles.Files
    : %>
    : <%= thing.Name %>
    : <%
    : Next
    : %>
    :
    : <%
    : filefound = nothing
    : directory = nothing
    : allfiles = nothing
    : %>
    :
    : Whats wrong with my path? does vbscript not like \? if i cant do that, can i do it via asp/javascript? (i tried but i couldnt display the items...or find the path)
    :
    : <3 steve.
    :


    What's the name of your folder? Is it in the same machine and within your root directory ? I think it has to be


  • : : the error:
    : :
    : : Server.MapPath() error 'ASP 0174 : 80004005'
    : :
    : : Invalid Path Character(s)
    : :
    : : /administration/stratplan/NewYorkTeam.asp, line 6
    : :
    : : An invalid '/' or '' was found in the Path parameter for the MapPath method.
    : :
    : : the code:
    : :
    : : <%
    : : set directory = Server.CreateObject("Scripting.FileSystemObject")
    : : ' line 6 below
    : : set allfiles = directory.GetFolder(Server.MapPath("\serverfolder"))
    : : %>
    : :
    : : <%
    : : For Each thing In allfiles.Files
    : : %>
    : : <%= thing.Name %>
    : : <%
    : : Next
    : : %>
    : :
    : : <%
    : : filefound = nothing
    : : directory = nothing
    : : allfiles = nothing
    : : %>
    : :
    : : Whats wrong with my path? does vbscript not like \? if i cant do that, can i do it via asp/javascript? (i tried but i couldnt display the items...or find the path)
    : :
    : : <3 steve.
    : :
    :
    :
    : What's the name of your folder? Is it in the same machine and within your root directory ? I think it has to be
    :
    :
    :

    its on a different computer within the network.

    <3 steve.

  • : : : the error:
    : : :
    : : : Server.MapPath() error 'ASP 0174 : 80004005'
    : : :
    : : : Invalid Path Character(s)
    : : :
    : : : /administration/stratplan/NewYorkTeam.asp, line 6
    : : :
    : : : An invalid '/' or '' was found in the Path parameter for the MapPath method.
    : : :
    : : : the code:
    : : :
    : : : <%
    : : : set directory = Server.CreateObject("Scripting.FileSystemObject")
    : : : ' line 6 below
    : : : set allfiles = directory.GetFolder(Server.MapPath("\serverfolder"))
    : : : %>
    : : :
    : : : <%
    : : : For Each thing In allfiles.Files
    : : : %>
    : : : <%= thing.Name %>
    : : : <%
    : : : Next
    : : : %>
    : : :
    : : : <%
    : : : filefound = nothing
    : : : directory = nothing
    : : : allfiles = nothing
    : : : %>
    : : :
    : : : Whats wrong with my path? does vbscript not like \? if i cant do that, can i do it via asp/javascript? (i tried but i couldnt display the items...or find the path)
    : : :
    : : : <3 steve.
    : : :
    : :
    : :
    : : What's the name of your folder? Is it in the same machine and within your root directory ? I think it has to be
    : :
    : :
    : :
    :
    : its on a different computer within the network.
    :
    : <3 steve.
    :
    :


    Have you tried without the mappath bit ? I think mappath works only for fiolders within the webroot (wwwroot).

    Have you tried this ?

    [code]
    set directory = Server.CreateObject("Scripting.FileSystemObject")
    : : : ' line 6 below
    set allfiles = directory.GetFolder("\serverfolder")

    [/code]
    ??

    And it is always better not to name objects/variables like "directory",
    "folder" etc. *could* cause problems for you. "mydirectory,myfolder etc." are safer.

    Also IUSR_machinename ( where machinename is the name of your machine which runs the IIS) should have permissions on the specific folder you are accessing.


    HTH.
  • : : : : the error:
    : : : :
    : : : : Server.MapPath() error 'ASP 0174 : 80004005'
    : : : :
    : : : : Invalid Path Character(s)
    : : : :
    : : : : /administration/stratplan/NewYorkTeam.asp, line 6
    : : : :
    : : : : An invalid '/' or '' was found in the Path parameter for the MapPath method.
    : : : :
    : : : : the code:
    : : : :
    : : : : <%
    : : : : set directory = Server.CreateObject("Scripting.FileSystemObject")
    : : : : ' line 6 below
    : : : : set allfiles = directory.GetFolder(Server.MapPath("\serverfolder"))
    : : : : %>
    : : : :
    : : : : <%
    : : : : For Each thing In allfiles.Files
    : : : : %>
    : : : : <%= thing.Name %>
    : : : : <%
    : : : : Next
    : : : : %>
    : : : :
    : : : : <%
    : : : : filefound = nothing
    : : : : directory = nothing
    : : : : allfiles = nothing
    : : : : %>
    : : : :
    : : : : Whats wrong with my path? does vbscript not like \? if i cant do that, can i do it via asp/javascript? (i tried but i couldnt display the items...or find the path)
    : : : :
    : : : : <3 steve.
    : : : :
    : : :
    : : :
    : : : What's the name of your folder? Is it in the same machine and within your root directory ? I think it has to be
    : : :
    : : :
    : : :
    : :
    : : its on a different computer within the network.
    : :
    : : <3 steve.
    : :
    : :
    :
    :
    : Have you tried without the mappath bit ? I think mappath works only for fiolders within the webroot (wwwroot).
    :
    : Have you tried this ?
    :
    : [code]
    : set directory = Server.CreateObject("Scripting.FileSystemObject")
    : : : : ' line 6 below
    : set allfiles = directory.GetFolder("\serverfolder")
    :
    : [/code]
    : ??
    :
    : And it is always better not to name objects/variables like "directory",
    : "folder" etc. *could* cause problems for you. "mydirectory,myfolder etc." are safer.
    :
    : Also IUSR_machinename ( where machinename is the name of your machine which runs the IIS) should have permissions on the specific folder you are accessing.
    :
    :
    : HTH.
    :

    i got it working. i just had to physically map the directory on the server and type the physical server path in the asp.

    <3 steve.

  • [b][red]This message was edited by Flakes at 2003-7-30 6:18:35[/red][/b][hr]
    : : : : : the error:
    : : : : :
    : : : : : Server.MapPath() error 'ASP 0174 : 80004005'
    : : : : :
    : : : : : Invalid Path Character(s)
    : : : : :
    : : : : : /administration/stratplan/NewYorkTeam.asp, line 6
    : : : : :
    : : : : : An invalid '/' or '' was found in the Path parameter for the MapPath method.
    : : : : :
    : : : : : the code:
    : : : : :
    : : : : : <%
    : : : : : set directory = Server.CreateObject("Scripting.FileSystemObject")
    : : : : : ' line 6 below
    : : : : : set allfiles = directory.GetFolder(Server.MapPath("\serverfolder"))
    : : : : : %>
    : : : : :
    : : : : : <%
    : : : : : For Each thing In allfiles.Files
    : : : : : %>
    : : : : : <%= thing.Name %>
    : : : : : <%
    : : : : : Next
    : : : : : %>
    : : : : :
    : : : : : <%
    : : : : : filefound = nothing
    : : : : : directory = nothing
    : : : : : allfiles = nothing
    : : : : : %>
    : : : : :
    : : : : : Whats wrong with my path? does vbscript not like \? if i cant do that, can i do it via asp/javascript? (i tried but i couldnt display the items...or find the path)
    : : : : :
    : : : : : <3 steve.
    : : : : :
    : : : :
    : : : :
    : : : : What's the name of your folder? Is it in the same machine and within your root directory ? I think it has to be
    : : : :
    : : : :
    : : : :
    : : :
    : : : its on a different computer within the network.
    : : :
    : : : <3 steve.
    : : :
    : : :
    : :
    : :
    : : Have you tried without the mappath bit ? I think mappath works only for fiolders within the webroot (wwwroot).
    : :
    : : Have you tried this ?
    : :
    : : [code]
    : : set directory = Server.CreateObject("Scripting.FileSystemObject")
    : : : : : ' line 6 below
    : : set allfiles = directory.GetFolder("\serverfolder")
    : :
    : : [/code]
    : : ??
    : :
    : : And it is always better not to name objects/variables like "directory",
    : : "folder" etc. *could* cause problems for you. "mydirectory,myfolder etc." are safer.
    : :
    : : Also IUSR_machinename ( where machinename is the name of your machine which runs the IIS) should have permissions on the specific folder you are accessing.
    : :
    : :
    : : HTH.
    : :
    :
    : i got it working. i just had to physically map the directory on the server and type the physical server path in the asp.
    :
    : <3 steve.
    :
    :

    Cool.

    [size=4][b][blue]Fl[/blue][red]a[/red][blue]kes[/blue][/b][/size]



Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories