PDA

View Full Version : ASP Question



Miles
09-11-2003, 02:00 PM
The forum for ASP seems to be pretty dead, so I thought I'd have better luck here. Apologies in advance if this irks someone. :?

I'm trying to correct some ASP code that stopped working with the recent "upgrade". When the code still worked, this returned the correct location of a file:

Set ReadStream = FileStreamObject.OpenTextFile (Server.MapPath ("/KuNoIchi") & "/file.txt", 1)

I used this to open a file to do a search. This line of code returns errors now, and I've experimented with a variety of different possibilities, such as:

Set ReadStream = FileStreamObject.OpenTextFile (Server.MapPath ("/var/www/html/haremail.com-asp/KuNoIchi") & "/file.txt", 1)

Set ReadStream = FileStreamObject.OpenTextFile (Server.MapPath ("/var/www/html/haremail.com-asp//KuNoIchi") & "/file.txt", 1)

Set ReadStream = FileStreamObject.OpenTextFile (Server.MapPath ("/var/www/html/KuNoIchi") & "/file.txt", 1)

Set ReadStream = FileStreamObject.OpenTextFile (Server.MapPath ("/html/KuNoIchi") & "/file.txt", 1)

...and ever a few others that I can't remember right now. None resolve to the correct path. I've even experimented with the double "//" marks, since a page like:

http://www.haremail.com/test.asp

...now resolves to:

http://www.haremail.com/haremail.com-asp//test.asp

Any tips? This is driving me batty!

wildjokerdesign
09-11-2003, 02:14 PM
I am not familiar witn ASP but in looking at the test page it shows.

Path_Info: /haremail.com-asp//test.asp

so would one of these maybe work?

/haremail.com-asp/KuNoIchi/
/haremail.com-asp/KuNoIchi

Please excuse my post if it something you already tried.

Miles
09-11-2003, 03:47 PM
Amazing....it must have been the only one I didn't try, and it's the obvious one. It worked. Thanks! :D

PS123
04-03-2004, 10:30 AM
I have the same problem. Itry to reproduce your solution and it does not work. That is what I see each time.

"You are not permitted to access a file which is not located within your ASP application's root."

Could you write the whole string with OpenTextFile(Server.MapPath("/....com-asp/") as it works with your ASP?