ASP - Error Server.MapPath

 
Vista:

Error Server.MapPath

Publicado por Pelu_W (1 intervención) el 28/05/2002 12:20:38
Server.MapPath(), ASP 0172 (0x80004005)
El parámetro Path del método MapPath debe ser una ruta de acceso virtual. Se utilizó una ruta de acceso física.

Porque me da este error?

en la línea --> If ObjetoFSO.FileExists(Server.MapPath("c:/Caratulas/Z-" & Busco("Caratula"))) Then

Gracias.
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder

RE:Error Server.MapPath

Publicado por Avatar (150 intervenciones) el 31/05/2002 21:49:13
El problema que tenes es que pasarle el path virtual de un archivo o cualquier cosa, no el físico.
Te paso un documento de como usar el Server.Mappath()

Using Server.MapPath

--------------------------------------------------------------------------------

Each file on a Web server has two ways of being accessed - through a virtual path and through a physical path. The virtual path is the path one would enter into their browser's Address bar, for example:

http://www.yourserver.com/someDirectory/someFile.asp

The bold part of the URL above is referred to as the virtual path. The physical path is the actual drive, directory, and filename of a particular file on the Web server. For example, on your computer, if you run Windows 9X, your Win.ini file's physical path is C:\WINDOWS\WIN.INI (assuming you installed Windows on your C: drive).

You can obtain the virtual path of a particular ASP page by using the Request.ServerVariables collection.

Response.Write Request.ServerVariables("PATH_INFO")

will output the virtual path of the ASP page it is entered into. There is no item in the ServerVariables collection that will yield the physical path of the current ASP page. (Note that there is an item that indicates the physical root directory.) So, how do we get the physical path of an ASP page given the virtual path? Furthermore, why would we want the physical path?

At times, it is essential that we have the physical path of a particular file or directory. For example, when usign the FileSystemObject, you often need the physical path. (Curious on learning more about the FileSystemObject? Visit our FileSystemObject FAQ%2
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar