I'm trying to understand fully Server.MapPath. I am writing an intranet for
a small company and want to be able to put some files accessible to all,
hyperlinked from the intranet and therefore, outside of the website area -
the idea being that I want staff to be able to copy files into folders that
can be accessed by hyperlinks on the intranet pages.
I've had a problem separating them from the intranet HTML and ASP pages,
which is obviously important as I do not want staff to be able to amend the
intranet pages themselves.
At the moment I have a structure that looks like this.
c:\inetpub\intr anet where all the HTML and ASP files will be held,
i.e., the root of my "website".
the files to be copied into folders will go into subfolders and I'm sure
this is where I have gone wrong.. they should go somewhere else, but I am
not sure then how to hyperlink to files that are not within the "website".
c:\inetpub\intr anet\intranetfi les
I tried putting the files in a folder "away" from the intranet HTML files...
c:\inetpub\intr anetfiles - but that was one step back from the website and
I could not link to them for some reason. I do not know how to link to files
that are somewhere else on the server, e.g., c:\intranetfile s. I want staff
to "see" and access that folder, but not the intranet website.. I'm a bit
stuck on this.
Can someone explain to me why it is that Option (A) below returns
c:\inetpub\intr anet and Option (B) returns
C:\WINDOWS\SYST EM\inetsrv\iisa dmin. Is it because the inetsrv folder is part
of the "website"? this has confused me.
A) Response.Write Server.Mappath( "/") & "<br>"
B) Response.Write Server.Mappath( "\iisadmin" ) & "<br>"
Thanks
Laura TD 7 2354
"/" is the website root
"/iisadmin" is the IIS errr "iisadmin" folder (which btw, should be disabled! (download and run IISLockdown))
IISLockdown: http://surl.co.uk/?1455
Original URL: http://www.microsoft.com/downloads/d...displaylang=en
As for your layout, if I'm understanding correctly, you have two site's;
/root
/root/intranet
and you want to be able to access the files in /root from /root/intranet?
If this is the case, you can (assuming you've allowed it in the IIS settings) use parent paths;
.../somefileinthero ot.htm
Where ../ is the level. So for example, if your intranet was in;
/root/intranet/someotherfolder
you would use;
.../../somefileinthero ot.htm
or quite simply;
/somefileinthero ot.htm
It should be noted however, if the intranet is inside the root (/root/intranet), you'll need to move it elsewhere if your not wanting it to be accessed via the outside world, or alternatively, use NTFS permissions to stop it being accessed by unauthorised personnel.
--
Regards
Steven Burn
Ur I.T. Mate Group www.it-mate.co.uk
Keeping it FREE!
"laura" <re*****@group. com> wrote in message news:OB******** ******@TK2MSFTN GP14.phx.gbl... I'm trying to understand fully Server.MapPath. I am writing an intranet for a small company and want to be able to put some files accessible to all, hyperlinked from the intranet and therefore, outside of the website area - the idea being that I want staff to be able to copy files into folders that can be accessed by hyperlinks on the intranet pages. I've had a problem separating them from the intranet HTML and ASP pages, which is obviously important as I do not want staff to be able to amend the intranet pages themselves. At the moment I have a structure that looks like this. c:\inetpub\intr anet where all the HTML and ASP files will be held, i.e., the root of my "website". the files to be copied into folders will go into subfolders and I'm sure this is where I have gone wrong.. they should go somewhere else, but I am not sure then how to hyperlink to files that are not within the "website". c:\inetpub\intr anet\intranetfi les I tried putting the files in a folder "away" from the intranet HTML files... c:\inetpub\intr anetfiles - but that was one step back from the website and I could not link to them for some reason. I do not know how to link to files that are somewhere else on the server, e.g., c:\intranetfile s. I want staff to "see" and access that folder, but not the intranet website.. I'm a bit stuck on this. Can someone explain to me why it is that Option (A) below returns c:\inetpub\intr anet and Option (B) returns C:\WINDOWS\SYST EM\inetsrv\iisa dmin. Is it because the inetsrv folder is part of the "website"? this has confused me. A) Response.Write Server.Mappath( "/") & "<br>" B) Response.Write Server.Mappath( "\iisadmin" ) & "<br>" Thanks Laura TD
"laura" <re*****@group. com> wrote in message
news:OB******** ******@TK2MSFTN GP14.phx.gbl... I'm trying to understand fully Server.MapPath. I am writing an intranet for a small company and want to be able to put some files accessible to all, hyperlinked from the intranet and therefore, outside of the website area - the idea being that I want staff to be able to copy files into folders that can be accessed by hyperlinks on the intranet pages.
I've had a problem separating them from the intranet HTML and ASP pages, which is obviously important as I do not want staff to be able to amend the intranet pages themselves.
At the moment I have a structure that looks like this.
c:\inetpub\intr anet where all the HTML and ASP files will be held, i.e., the root of my "website".
the files to be copied into folders will go into subfolders and I'm sure this is where I have gone wrong.. they should go somewhere else, but I am not sure then how to hyperlink to files that are not within the "website".
c:\inetpub\intr anet\intranetfi les
I tried putting the files in a folder "away" from the intranet HTML files...
c:\inetpub\intr anetfiles - but that was one step back from the website and I could not link to them for some reason. I do not know how to link to files that are somewhere else on the server, e.g., c:\intranetfile s. I want staff to "see" and access that folder, but not the intranet website.. I'm a bit stuck on this.
Can someone explain to me why it is that Option (A) below returns c:\inetpub\intr anet and Option (B) returns C:\WINDOWS\SYST EM\inetsrv\iisa dmin. Is it because the inetsrv folder is part of the "website"? this has confused me.
A) Response.Write Server.Mappath( "/") & "<br>" B) Response.Write Server.Mappath( "\iisadmin" ) & "<br>"
Server.MapPath turns a "virtual path" as defined within the web server, into
a physical path, that's meaningful to the server's file system. Apparently
you're using the Administration virtual server that installs with IIS?
Under it is defined a virtual directory called "\iisadmin. " The location
this virtual directory actually references is determined by the properties
of the virtual directory.
So what you need to do is create a virtual directory in your web root
(actually I'd disable that default site and create another one,) call the
virtual directory "files" or whatever else, and set it's physical directory
to c:\inetpub\intr anetfiles. You can then enable directory browsing for
that virtual directory, and all subdirs underneath it will inherit that
setting.
One thing that's very important: make SURE that execute and script execute
permissions are not enabled for the "files" virtual directory (i.e., any
directory in which users are allowed to create/modify files.)
Good Luck,
Mark
Thanks Laura TD
I'm sorry if I'm not being clear.
I think what I'm trying to achieve is to access files somewhere else on the
server or computer where the website/intranet resides, or even on a
different drive within the company if that's possible.. i.e., my intranet
resides in
/root and I want to be able to hyperlink to a file or files in
c:\companyfiles \
Can that be done or am I barking up the wrong tree? I am able to access any
file from /root down to any subfolder, but nothing above /root.
I am working from home and intend to install this on a server in an office
where I don't work on a daily basis.. there is an IT man there who
presumably will set these things up for me as explained by you below, but I
need to have an understanding as to where I can put company files separate
and away from the intranet itself. I will also have a couple of database
files which I want 'hidden' away from staff. The idea is that this is on a
local personal webserver/intranet and not open to the world wide web.
Sorry if I'm being confusing.
Laura
"Steven Burn" <so*******@in-time.invalid> wrote in message
news:%2******** *******@TK2MSFT NGP14.phx.gbl.. .
"/" is the website root
"/iisadmin" is the IIS errr "iisadmin" folder (which btw, should be
disabled! (download and run IISLockdown))
IISLockdown: http://surl.co.uk/?1455
Original URL: http://www.microsoft.com/downloads/d...displaylang=en
As for your layout, if I'm understanding correctly, you have two site's;
/root
/root/intranet
and you want to be able to access the files in /root from /root/intranet?
If this is the case, you can (assuming you've allowed it in the IIS
settings) use parent paths;
.../somefileinthero ot.htm
Where ../ is the level. So for example, if your intranet was in;
/root/intranet/someotherfolder
you would use;
.../../somefileinthero ot.htm
or quite simply;
/somefileinthero ot.htm
It should be noted however, if the intranet is inside the root
(/root/intranet), you'll need to move it elsewhere if your not wanting it to
be accessed via the outside world, or alternatively, use NTFS permissions to
stop it being accessed by unauthorised personnel.
--
Regards
Steven Burn
Ur I.T. Mate Group www.it-mate.co.uk
Keeping it FREE!
"laura" <re*****@group. com> wrote in message
news:OB******** ******@TK2MSFTN GP14.phx.gbl... I'm trying to understand fully Server.MapPath. I am writing an intranet for a small company and want to be able to put some files accessible to all, hyperlinked from the intranet and therefore, outside of the website area - the idea being that I want staff to be able to copy files into folders that can be accessed by hyperlinks on the intranet pages.
I've had a problem separating them from the intranet HTML and ASP pages, which is obviously important as I do not want staff to be able to amend the intranet pages themselves.
At the moment I have a structure that looks like this.
c:\inetpub\intr anet where all the HTML and ASP files will be held, i.e., the root of my "website".
the files to be copied into folders will go into subfolders and I'm sure this is where I have gone wrong.. they should go somewhere else, but I am not sure then how to hyperlink to files that are not within the "website".
c:\inetpub\intr anet\intranetfi les
I tried putting the files in a folder "away" from the intranet HTML files...
c:\inetpub\intr anetfiles - but that was one step back from the website and I could not link to them for some reason. I do not know how to link to files that are somewhere else on the server, e.g., c:\intranetfile s. I want staff to "see" and access that folder, but not the intranet website.. I'm a bit stuck on this.
Can someone explain to me why it is that Option (A) below returns c:\inetpub\intr anet and Option (B) returns C:\WINDOWS\SYST EM\inetsrv\iisa dmin. Is it because the inetsrv folder is part of the "website"? this has confused me.
A) Response.Write Server.Mappath( "/") & "<br>" B) Response.Write Server.Mappath( "\iisadmin" ) & "<br>"
Thanks Laura TD
No problem.
If your intranet is in /root and you want access to C:\companyfiles , you can either;
1. Use the FileSystemObjec t to access them
2. Use ../ to drill down
Note however, neither of the above will work if IUSR_<machine> does not have read permissions on them.
The latter will work if the /root folder is located on the same drive, otherwise you'll need to use the FileSystemObjec t (or one of the alternative's). For example;
<%
'// example.asp
Option Explicit
Dim objFSO, objFldr, objFl, iCount
Set objFSO = Server.CreateOb ject("Scripting .FileSystemObje ct")
Set objFldr = objFSO.GetFolde r("C:\companyfi les")
For Each objFl In objFldr.Files
Response.Write objFl.Name & " is located in: " & objFldr.Path & " and is " & objFl.Size & " bytes<br>"
iCount = iCount + 1
Next
Response.Write "************** *************** *************** <br>"
Response.Write iCount & " files found in " & objFldr.Path & "<br>"
Response.Write "************** *************** *************** <br>"
Set objFSO = Nothing
%>
If you want the intranet users to be able to actually use/modify/download the files, you'll additionally need to either;
1. Copy them to a temporary folder above the webroot, then delete them when they're finished with it
2. Use the Stream method to dynamically send it to them
3. Use the Content-Disposition tag to dynamically send it to them
--
Regards
Steven Burn
Ur I.T. Mate Group www.it-mate.co.uk
Keeping it FREE!
"laura" <re*****@group. com> wrote in message news:u2******** ******@TK2MSFTN GP14.phx.gbl... I'm sorry if I'm not being clear. I think what I'm trying to achieve is to access files somewhere else on the server or computer where the website/intranet resides, or even on a different drive within the company if that's possible.. i.e., my intranet resides in /root and I want to be able to hyperlink to a file or files in c:\companyfiles \ Can that be done or am I barking up the wrong tree? I am able to access any file from /root down to any subfolder, but nothing above /root. I am working from home and intend to install this on a server in an office where I don't work on a daily basis.. there is an IT man there who presumably will set these things up for me as explained by you below, but I need to have an understanding as to where I can put company files separate and away from the intranet itself. I will also have a couple of database files which I want 'hidden' away from staff. The idea is that this is on a local personal webserver/intranet and not open to the world wide web. Sorry if I'm being confusing. Laura "Steven Burn" <so*******@in-time.invalid> wrote in message news:%2******** *******@TK2MSFT NGP14.phx.gbl.. . "/" is the website root "/iisadmin" is the IIS errr "iisadmin" folder (which btw, should be disabled! (download and run IISLockdown)) IISLockdown: http://surl.co.uk/?1455 Original URL: http://www.microsoft.com/downloads/d...displaylang=en As for your layout, if I'm understanding correctly, you have two site's; /root /root/intranet and you want to be able to access the files in /root from /root/intranet? If this is the case, you can (assuming you've allowed it in the IIS settings) use parent paths; ../somefileinthero ot.htm Where ../ is the level. So for example, if your intranet was in; /root/intranet/someotherfolder you would use; ../../somefileinthero ot.htm or quite simply; /somefileinthero ot.htm It should be noted however, if the intranet is inside the root (/root/intranet), you'll need to move it elsewhere if your not wanting it to be accessed via the outside world, or alternatively, use NTFS permissions to stop it being accessed by unauthorised personnel. -- Regards Steven Burn Ur I.T. Mate Group www.it-mate.co.uk Keeping it FREE! "laura" <re*****@group. com> wrote in message news:OB******** ******@TK2MSFTN GP14.phx.gbl... I'm trying to understand fully Server.MapPath. I am writing an intranet for a small company and want to be able to put some files accessible to all, hyperlinked from the intranet and therefore, outside of the website area - the idea being that I want staff to be able to copy files into folders that can be accessed by hyperlinks on the intranet pages.
I've had a problem separating them from the intranet HTML and ASP pages, which is obviously important as I do not want staff to be able to amend the intranet pages themselves.
At the moment I have a structure that looks like this.
c:\inetpub\intr anet where all the HTML and ASP files will be held, i.e., the root of my "website".
the files to be copied into folders will go into subfolders and I'm sure this is where I have gone wrong.. they should go somewhere else, but I am not sure then how to hyperlink to files that are not within the "website".
c:\inetpub\intr anet\intranetfi les
I tried putting the files in a folder "away" from the intranet HTML files...
c:\inetpub\intr anetfiles - but that was one step back from the website and I could not link to them for some reason. I do not know how to link to files that are somewhere else on the server, e.g., c:\intranetfile s. I want staff to "see" and access that folder, but not the intranet website.. I'm a bit stuck on this.
Can someone explain to me why it is that Option (A) below returns c:\inetpub\intr anet and Option (B) returns C:\WINDOWS\SYST EM\inetsrv\iisa dmin. Is it because the inetsrv folder is part of the "website"? this has confused me.
A) Response.Write Server.Mappath( "/") & "<br>" B) Response.Write Server.Mappath( "\iisadmin" ) & "<br>"
Thanks Laura TD
Dear Steven,
Thanks for your advice. I'm afraid you've lost me on the last 3 options, I'm
not sufficiently clever to be able to apply your suggestions.
At this time the "problem" I have run into is that I have more or less
written the intranet in HTML and have used ASP on just one page where I want
specified people to be able to log in to amend on aspect. This is working
fine and with the advice you gave below I can at least put the users.mdb
file somewhere inaccessible.
However, for all the "company files" (forms, handbooks etc.) I could not
figure out a way of putting them somewhere else on the server, away from the
intranet files and then to be able to hyperlink to them. I could not "see"
beyond the root. Therefore I had to stick in a folder called "companyfil es"
as a sub folder from the root - and this folder will be accessible by any
employee who is authorised to copy files into the subdirectories. I really
did not want all the intranet (HTML) files to also be visible, but could not
see a way around it. Using the FileSystemObjec t seems to be the solution and
I think this means turning all the HTML pages into ASP pages and
hyperlinking using the FileSystemObjec t. I will have to rewrite most of what
I have done.
I thought I would just explain the situation so far and thank you for your
help.
Laura TD
"Steven Burn" <so*******@in-time.invalid> wrote in message
news:uM******** ******@TK2MSFTN GP09.phx.gbl...
No problem.
If your intranet is in /root and you want access to C:\companyfiles , you can
either;
1. Use the FileSystemObjec t to access them
2. Use ../ to drill down
Note however, neither of the above will work if IUSR_<machine> does not have
read permissions on them.
The latter will work if the /root folder is located on the same drive,
otherwise you'll need to use the FileSystemObjec t (or one of the
alternative's). For example;
<%
'// example.asp
Option Explicit
Dim objFSO, objFldr, objFl, iCount
Set objFSO = Server.CreateOb ject("Scripting .FileSystemObje ct")
Set objFldr = objFSO.GetFolde r("C:\companyfi les")
For Each objFl In objFldr.Files
Response.Write objFl.Name & " is located in: " & objFldr.Path & "
and is " & objFl.Size & " bytes<br>"
iCount = iCount + 1
Next
Response.Write "************** *************** *************** <br>"
Response.Write iCount & " files found in " & objFldr.Path & "<br>"
Response.Write "************** *************** *************** <br>"
Set objFSO = Nothing
%>
If you want the intranet users to be able to actually use/modify/download
the files, you'll additionally need to either;
1. Copy them to a temporary folder above the webroot, then delete them when
they're finished with it
2. Use the Stream method to dynamically send it to them
3. Use the Content-Disposition tag to dynamically send it to them
--
Regards
Steven Burn
Ur I.T. Mate Group www.it-mate.co.uk
Keeping it FREE!
"laura" <re*****@group. com> wrote in message
news:u2******** ******@TK2MSFTN GP14.phx.gbl... I'm sorry if I'm not being clear.
I think what I'm trying to achieve is to access files somewhere else on the server or computer where the website/intranet resides, or even on a different drive within the company if that's possible.. i.e., my intranet resides in
/root and I want to be able to hyperlink to a file or files in
c:\companyfiles \
Can that be done or am I barking up the wrong tree? I am able to access any file from /root down to any subfolder, but nothing above /root.
I am working from home and intend to install this on a server in an office where I don't work on a daily basis.. there is an IT man there who presumably will set these things up for me as explained by you below, but I need to have an understanding as to where I can put company files separate and away from the intranet itself. I will also have a couple of database files which I want 'hidden' away from staff. The idea is that this is on a local personal webserver/intranet and not open to the world wide web.
Sorry if I'm being confusing.
Laura
"Steven Burn" <so*******@in-time.invalid> wrote in message news:%2******** *******@TK2MSFT NGP14.phx.gbl.. . "/" is the website root "/iisadmin" is the IIS errr "iisadmin" folder (which btw, should be disabled! (download and run IISLockdown))
IISLockdown: http://surl.co.uk/?1455
Original URL: http://www.microsoft.com/downloads/d...displaylang=en
As for your layout, if I'm understanding correctly, you have two site's;
/root /root/intranet
and you want to be able to access the files in /root from /root/intranet?
If this is the case, you can (assuming you've allowed it in the IIS settings) use parent paths;
../somefileinthero ot.htm
Where ../ is the level. So for example, if your intranet was in;
/root/intranet/someotherfolder
you would use;
../../somefileinthero ot.htm
or quite simply;
/somefileinthero ot.htm
It should be noted however, if the intranet is inside the root (/root/intranet), you'll need to move it elsewhere if your not wanting it to be accessed via the outside world, or alternatively, use NTFS permissions to stop it being accessed by unauthorised personnel.
-- Regards
Steven Burn Ur I.T. Mate Group www.it-mate.co.uk
Keeping it FREE!
"laura" <re*****@group. com> wrote in message news:OB******** ******@TK2MSFTN GP14.phx.gbl... I'm trying to understand fully Server.MapPath. I am writing an intranet for a small company and want to be able to put some files accessible to all, hyperlinked from the intranet and therefore, outside of the website area - the idea being that I want staff to be able to copy files into folders that can be accessed by hyperlinks on the intranet pages.
I've had a problem separating them from the intranet HTML and ASP pages, which is obviously important as I do not want staff to be able to amend the intranet pages themselves.
At the moment I have a structure that looks like this.
c:\inetpub\intr anet where all the HTML and ASP files will be held, i.e., the root of my "website".
the files to be copied into folders will go into subfolders and I'm sure this is where I have gone wrong.. they should go somewhere else, but I am not sure then how to hyperlink to files that are not within the "website".
c:\inetpub\intr anet\intranetfi les
I tried putting the files in a folder "away" from the intranet HTML files...
c:\inetpub\intr anetfiles - but that was one step back from the website and I could not link to them for some reason. I do not know how to link to files that are somewhere else on the server, e.g., c:\intranetfile s. I want staff to "see" and access that folder, but not the intranet website.. I'm a bit stuck on this.
Can someone explain to me why it is that Option (A) below returns c:\inetpub\intr anet and Option (B) returns C:\WINDOWS\SYST EM\inetsrv\iisa dmin. Is it because the inetsrv folder is part of the "website"? this has confused me.
A) Response.Write Server.Mappath( "/") & "<br>" B) Response.Write Server.Mappath( "\iisadmin" ) & "<br>"
Thanks Laura TD
laura wrote: Dear Steven,
Thanks for your advice. I'm afraid you've lost me on the last 3 options, I'm not sufficiently clever to be able to apply your suggestions.
At this time the "problem" I have run into is that I have more or less written the intranet in HTML and have used ASP on just one page where I want specified people to be able to log in to amend on aspect. This is working fine and with the advice you gave below I can at least put the users.mdb file somewhere inaccessible.
However, for all the "company files" (forms, handbooks etc.) I could not figure out a way of putting them somewhere else on the server, away from the intranet files and then to be able to hyperlink to them.
If you need to hyperlink to tem, then they need to be in your site. However,
there is an alternative to hyperlinking to them: you can use an ADO Stream
object on server-side to read a file outside the web and stream to contents
to the client. I think Curt has an example of this at his DarkFalz site.
Bob Barrows
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
[I'm assuming you did not see my reply, so I'm re-posting it here, out of
it's thread context.] Can someone explain to me why it is that Option (A) below returns c:\inetpub\intr anet and Option (B) returns C:\WINDOWS\SYST EM\inetsrv\iisa dmin. Is it because the inetsrv folder is part of the "website"? this has confused me.
A) Response.Write Server.Mappath( "/") & "<br>" B) Response.Write Server.Mappath( "\iisadmin" ) & "<br>"
Server.MapPath turns a "virtual path" as defined within the web server, into
a physical path, that's meaningful to the server's file system. Apparently
you're using the Administration virtual server that installs with IIS?
Under it is defined a virtual directory called "\iisadmin. " The location
this virtual directory actually references is determined by the properties
of the virtual directory.
So what you need to do is create a virtual directory in your web root
(actually I'd disable that default site and create another one,) call the
virtual directory "files" or whatever else, and set it's physical directory
to c:\inetpub\intr anetfiles. You can then enable directory browsing for
that virtual directory, and all subdirs underneath it will inherit that
setting.
One thing that's very important: make SURE that execute and script execute
permissions are not enabled for the "files" virtual directory (i.e., any
directory in which users are allowed to create/modify files.)
Good Luck,
Mark This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: John Rebbeck |
last post by:
I've got the directory f:\Company\Product set as web shared so it's got a
virtual directory in the default web site on my test server's IIS. If I try
to use Server.MapPath in that site it returns a path within
c:\Inetpub\wwwroot rather than the real path.
Can anyone please tell me why this isn't working?
Regards,
John
|
by: Laphan |
last post by:
Hi All
Sorry to be irate, but the whole concept of Server.MapPaths really has me in
a tiswas!!
In order to confirm once and for all, could you please advise me on the
following:
1) There is no difference in putting '/' or '\' in the Server.MapPath param,
eg Server.MapPath("/fred/test.asp") or Server.MapPath("\fred\test.asp") -
|
by: darrel |
last post by:
I have some functions that are reading/writing to the file system. As such,
they use server.mapPath a lot to navigate it all.
Since I'm using these functions numerous times throughout my application, I
thought I'd move these into their own .vb class file and reference them that
way.
The catch is when moving these scripts over, 'Server.MapPath' turns into an
error "Name 'server' is not declared"
|
by: benoit |
last post by:
Hi,
if I write this code to retrieve a folder on the server
Server.mappath("/DATA")
I get this error message
System.InvalidOperationException: Failed to map the path '/DATA'
the virtual folder for my webApp is not situated in Inetpub, nor is the DATA
folder that I would like to retrieve
|
by: MichiMichi |
last post by:
When using Server.MapPath on IIS 5 on my localhost everything works
well. All of the following commands are executed without any error
Response.Write(Server.MapPath("/app_test") & "<br>")
Response.Write(Server.MapPath("app_test") & "<br>")
Response.Write(Server.MapPath("~") & "<br>")
However, running the first statement on via the internal Visual Studio
2005 Server I receive an error for
| |
by: vunet.us |
last post by:
How to use server.mappath() parent folder correctly:
Server.MapPath("../test.asp")
Thank you for the hint.
|
by: rn5a |
last post by:
Server.MapPath returns the physical file path that corresponds to the
specified virtual path whereas Request.MapPath maps the specified
virtual path to a physical path. Assuming that a file named Hello.aspx
resides in C:\Inetpub\wwwroot\MyFolder, the output of both
Response.Write(Server.MapPath("Hello.aspx"))
&
Response.Write(Request.MapPath("Hello.aspx"))
|
by: withers |
last post by:
If I run Server.MapPath("/") on my operational Internet server I get,
correctly, the physical path to the directory my page is in (d:\....
\...\htdocs).
If I run Server.MapPath("/") on my intranet server, my localhost, I
get c:\inetpub\wwwroot, but my webpages are NOT in this folder, they
are in c:\webtest.
How to I establish the correct physical root on my intranet server?
|
by: =?Utf-8?B?YzY3NjIyOA==?= |
last post by:
Hi all,
I have one line code in my program, occasionaly I will receive the following
error:
"The Path parameter for the MapPath method did not correspond to a known path"
Path=Server.MapPath(sCertPath & "\" & order_id & ".pdf")
I am wondering what is happening since every time I check my error log, the
|
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
| |
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |