Home All Groups Group Topic Archive Search About

Finding absolute file path on server?



Author
17 Mar 2006 7:59 PM
Paul
I am trying to create a log of certain events on the website by writing them
to a text file.  The logging code is in an "included" file that is inserted
into the pages that need to be monitored. Currently, the target text file is
just specified in the FSO MapPath as "thelog.txt", so it writes the log to a
text file within the same folder as the web page.

The problem is that I don't want to grant browsers Write access to my pages
folder, so I need to have a separate directory to hold the log text file
that browsers can have Write access to. The web site is hosted on a shared
server that I do not have direct access to.  In the past, occasionally an
error has popped up that states the exact location, but I can not get that
to repeat. I know it is something like "D:\customers\myuserid\www\"

How can I find out the actual location on the server so I can use an
absolute path to write all the logs to one file in one location?

Thanks.
Paul

Author
17 Mar 2006 8:08 PM
Evertjan.
Paul wrote on 17 mrt 2006 in microsoft.public.inetserver.asp.general:

> The problem is that I don't want to grant browsers Write access to my
> pages folder, so I need to have a separate directory to hold the log
> text file that browsers can have Write access to.

How would you give server directory write access to a browser?

Only by giving the browser html form submitting the specification of the
directory.

ASP code resideas on the server and can have write access wherever you
like, without the browser having such access privilege.

So simply write correct and safe ASP vbs or js code.

Absolute path is found with server.mappath()

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Author
17 Mar 2006 9:34 PM
Paul
Evertjan,

Thank you for replying. You must have posted at the same time I did.

My server control panel has a tool to set what level of permission that
browsers have. It allows none, read, read/write, or read/write/delete for
any user, including anonymous browsers.

I'm still trying to figure the permissions side of things out, as now I have
removed all access for browsers yet it functions properly. That fits your
statement about ASP code not requiring browser access privilege. However,
the odd thing is that an administrative user with full RWD privileges is
getting Permission Denied errors on the same script.

Paul

Show quote
"Evertjan." <exjxw.hannivo***@interxnl.net> wrote in message
news:Xns9789D7181C03Deejj99@194.109.133.242...
> Paul wrote on 17 mrt 2006 in microsoft.public.inetserver.asp.general:
>
>> The problem is that I don't want to grant browsers Write access to my
>> pages folder, so I need to have a separate directory to hold the log
>> text file that browsers can have Write access to.
>
> How would you give server directory write access to a browser?
>
> Only by giving the browser html form submitting the specification of the
> directory.
>
> ASP code resideas on the server and can have write access wherever you
> like, without the browser having such access privilege.
>
> So simply write correct and safe ASP vbs or js code.
>
> Absolute path is found with server.mappath()
>
> --
> Evertjan.
> The Netherlands.
> (Please change the x'es to dots in my emailaddress)
Author
17 Mar 2006 11:49 PM
Evertjan.
Paul wrote on 17 mrt 2006 in microsoft.public.inetserver.asp.general:

[please do not toppost on usenet]

> Thank you for replying. You must have posted at the same time I did.
>
> My server control panel has a tool to set what level of permission
> that browsers have. It allows none, read, read/write, or
> read/write/delete for any user, including anonymous browsers.

You are talking about permissions of internet or intranet connections.

That is not the same as a browser permission. a browser permission is a
clientside permission to access clientside HDs.

> I'm still trying to figure the permissions side of things out, as now
> I have removed all access for browsers yet it functions properly. That
> fits your statement about ASP code not requiring browser access
> privilege. However, the odd thing is that an administrative user with
> full RWD privileges is getting Permission Denied errors on the same
> script.

You could change the standard permission set for the IIS owner, but I would
in general not do that, exept for one directory, like a cgi directory.

You could later forget what you had set them to, creating a security risk.

Just choose the right directory for the task at hand.


--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Author
17 Mar 2006 8:09 PM
Paul
Found what I needed, log is working now. Here is what I found, in case
anyone else has the same problem.

<%
Dim ServerPath

ServerPath =Server.MapPath(".")

Response.Write ServerPath

%>

Show quote
"Paul" <nospam@mydomain.com> wrote in message
news:uMv7m1fSGHA.5156@TK2MSFTNGP10.phx.gbl...
>I am trying to create a log of certain events on the website by writing
>them to a text file.  The logging code is in an "included" file that is
>inserted into the pages that need to be monitored. Currently, the target
>text file is just specified in the FSO MapPath as "thelog.txt", so it
>writes the log to a text file within the same folder as the web page.
>
> The problem is that I don't want to grant browsers Write access to my
> pages folder, so I need to have a separate directory to hold the log text
> file that browsers can have Write access to. The web site is hosted on a
> shared server that I do not have direct access to.  In the past,
> occasionally an error has popped up that states the exact location, but I
> can not get that to repeat. I know it is something like
> "D:\customers\myuserid\www\"
>
> How can I find out the actual location on the server so I can use an
> absolute path to write all the logs to one file in one location?
>
> Thanks.
> Paul
>
Author
20 Mar 2006 3:35 AM
Kyle Peterson
http://www.powerasp.com/content/hintstips/physical-path.asp

Show quote
"Paul" <nospam@mydomain.com> wrote in message
news:uMv7m1fSGHA.5156@TK2MSFTNGP10.phx.gbl...
>I am trying to create a log of certain events on the website by writing
>them to a text file.  The logging code is in an "included" file that is
>inserted into the pages that need to be monitored. Currently, the target
>text file is just specified in the FSO MapPath as "thelog.txt", so it
>writes the log to a text file within the same folder as the web page.
>
> The problem is that I don't want to grant browsers Write access to my
> pages folder, so I need to have a separate directory to hold the log text
> file that browsers can have Write access to. The web site is hosted on a
> shared server that I do not have direct access to.  In the past,
> occasionally an error has popped up that states the exact location, but I
> can not get that to repeat. I know it is something like
> "D:\customers\myuserid\www\"
>
> How can I find out the actual location on the server so I can use an
> absolute path to write all the logs to one file in one location?
>
> Thanks.
> Paul
>

AddThis Social Bookmark Button