The ‘..’ characters are not allowed in the Path parameter for the MapPath method.

Stamane mi è capitato di dover caricare un file “word” mediante un’applicazione da me realizzata in ASP ed ho riscontrato il seguente errore:

Server.MapPath(), ASP 0175 (0x80004005)
The ‘..’ characters are not allowed in the Path parameter for the MapPath
method

In pratica il nome era il seguente: “..Ciao.doc”, il sistema interpreta “..” come ad un riferimento a un file in una cartella principale.

Per ovviare a questo basta utilizzare un percorso relativo alla radice, piuttosto che relativo alla cartella corrente.

Modifica effettuata sul codice:

If Fso.FileExists(Server.MapPath(“”&CartellaVirtualeUpload&NomeFile&””)) = True then

con il seguente:

If Fso.FileExists((“”&CartellaFisicaUpload&NomeFile&””)) = True then

 

Grazie per l’interesse!

One comment

Comments are closed.