Finding absolute file path on server?
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Web Servers reviews > IIS server support > IIS ASP > Finding absolute file path on server?




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    Finding absolute file path on server?  
Paul


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
03-17-06 10:54 PM

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







[ Post a follow-up to this message ]



    Re: Finding absolute file path on server?  
Evertjan.


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
03-17-06 10:54 PM

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)





[ Post a follow-up to this message ]



    Re: Finding absolute file path on server?  
Paul


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
03-17-06 10:54 PM

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

%>

"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
>







[ Post a follow-up to this message ]



    Re: Finding absolute file path on server?  
Paul


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
03-17-06 10:54 PM

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

"Evertjan." <exjxw.hannivoort@interxnl.net> wrote in message
news:Xns9789D7181C03Deejj99@194.109.133.242...
> Paul wrote on 17 mrt 2006 in microsoft.public.inetserver.asp.general:
> 
>
> 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)







[ Post a follow-up to this message ]



    Re: Finding absolute file path on server?  
Evertjan.


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
03-17-06 10:54 PM

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)





[ Post a follow-up to this message ]



    Re: Finding absolute file path on server?  
Kyle Peterson


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
03-21-06 08:16 AM

http://www.powerasp.com/content/hin...ysical-path.asp

"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
>







[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 01:26 PM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register