Get ready for BLACK FRIDAY shopping starting in

Forums

ASP

This topic is locked

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

Posted 10 Apr 2003 18:51:23
1
has voted
10 Apr 2003 18:51:23 Phuc Ngo posted:
Hi everyone.

My code work fine sometime back and now all of a sudden it doesn't work anymore. It gives me the error below. Can someone help me fix it please... I really need it running again. I can't upload files now.
Thanks
-Dave


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

Disallowed Path Characters

/ScriptLibrary/incPureUpload.asp, line 162

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


Replies

Replied 11 Apr 2003 09:27:47
11 Apr 2003 09:27:47 Martha Graham replied:
Please send me your page, so I can take a look.



Martha Graham
DMXzone manager
Replied 13 Apr 2003 03:55:59
13 Apr 2003 03:55:59 alex ax replied:
i have the same trouble...!
maybee the reason is my upload directory ? there is no html support for this directory allowed. i have the error at line with the server.mappath

Replied 13 Apr 2003 04:00:29
13 Apr 2003 04:00:29 alex ax replied:
Technical Information (for support personnel)

Error Type:
Server.MapPath(), ASP 0175 (0x80004005)
The '..' characters are not allowed in the Path parameter for the MapPath method.
/realestate/edit/ScriptLibrary/incPureUpload.asp, line 204


Browser Type:
Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.0.3705)

Page:
POST 39236 bytes to /realestate/edit/pictures.upload.asp

POST Data:
error '80020009'
Exception occurred.

/scripts/500-100.asp, line 193


Replied 13 Aug 2008 20:10:49
13 Aug 2008 20:10:49 majid salehi replied:
using Server MapPath method.

Let us try some examples where different conditions we will apply to see the results. We kept the file mappath.asp inside my_file directory. So our total physical path looks like this.

C:\Inetpub\wwwroot\my_files\mappath.asp

Note that the object Server.MapPath does not check the existence of actual path, it only maps the given path along with the physical path. So any error in writing directory name or file name will not result in any error message. To make this point clear we are starting with one example of test.asp which is not existing inside the my_file directory. Here is the command and the output
response.write(Server.MapPath("test.asp"

The output of the above line is here

C:\Inetpub\wwwroot\my_files\test.asp

Here we have kept the code inside mappath.asp file and it has displayed the above line. Now let us try with different files and names , the output of the code is given in italic font.


response.write(Server.MapPath("my_files/mappath.asp"
C:\Inetpub\wwwroot\my_files\my_files\mappath.asp

With or without “/” or “\” mark at the staring of the path
If the file or directory name starts with / or \ then the path is taken as full virtual and it starts from server root. Otherwise it is considered from the path of the file being executed. Here are some examples with outputs shown in Italics.


response.write(Server.MapPath("/my_files/mappath.asp"
C:\Inetpub\wwwroot\my_files\mappath.asp


response.write(Server.MapPath("\test.asp"
C:\Inetpub\wwwroot\test.asp

Note the difference the \ mark at the staring of the file name has done. It has taken the root of the server even though the current script is executed inside my_files directory.

To get the root of the present script running we have to use like this.


response.write(Server.MapPath("."
C:\Inetpub\wwwroot\my_files

To get the server root we have to use


response.write(Server.MapPath("\"
C:\Inetpub\wwwroot

Reply to this topic