473,385 Members | 1,798 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Finding absolute file path on server?

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
Mar 17 '06 #1
5 6564
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)
Mar 17 '06 #2
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" <no****@mydomain.com> wrote in message
news:uM**************@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

Mar 17 '06 #3
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." <ex**************@interxnl.net> wrote in message
news:Xn********************@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)

Mar 17 '06 #4
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)
Mar 18 '06 #5
http://www.powerasp.com/content/hint...sical-path.asp

"Paul" <no****@mydomain.com> wrote in message
news:uM**************@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

Mar 20 '06 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Hal Vaughan | last post by:
I want to have a config file for my program, which means I need to know where the config file is. If I type: java myclass and it runs myclass.class, is there any way to obtain the location of...
11
by: Fuzzyman | last post by:
What's the best, cross platform, way of finding out the directory a script is run from ? I've googled a bit, but can't get a clear answer. On sys.argv the docs say : argv is the script name...
1
by: Sugapablo | last post by:
How can I find out the full directory path (i.e. c:\path\to\file) of a file? I'm logged into a server and the of course, I have an FTP directory root, but I need to know the absolute path. ...
11
by: Wolfgang Kaml | last post by:
Hello All, I have been working on this for almost a week now and I haven't anything up my sleeves anymore that I could test in addition or change.... Since I am not sure, if this is a Windows...
15
by: Nick K. | last post by:
I recently began maintenance work on a production web server that is located in the root directory of a web server. I moved this into a sub web on my local web server in order to do work on it. I...
3
by: Pooja Renukdas | last post by:
Hello, I have this web site where only two pages have to be secure pages and I need to call them using https, but since I have my development server and my production web server, I dont want to...
19
by: Jerry M. Gartner | last post by:
Greetings: What is the best way to resolve paths within a document regardless of what path it is opened under? For example: I have x.php and it contains <img src="images...">, (amongst other...
6
by: Jon Slaughter | last post by:
do I have to prefix every absolute path with document root to get it to work? For some reason I thought that prefixing a path with '/' or './' with make it absolute w.r.t to document root but I...
12
by: Jeff | last post by:
As I'm learning PHP, I'm making a fair number of mistakes in syntax. In perl, you can turn on reading these errors from the browser by adding this: use CGI::Carp 'fatalsToBrowser'; Is there...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.