473,420 Members | 1,618 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,420 software developers and data experts.

Read/Write to folder *above* site root

If MapPath is the way to go, then how can I reference the desired folder as
relative to the current site's root (I don't want to hard-code the path from
the C:\root folder). FWIW the logic that does the read/writing is in a
middle tier component (not in a code-behind module).

Suppose I need to write to the WriteHere folder:

C:\WebSites\Site52\WriteHere\

and the site root is elsewhere:
C:\WebSites\Site52\Sites\SiteRootHere\

Thanks for helping.
Nov 19 '05 #1
1 1401
Get the root (using MapPath or ApplicationPath) and use .. so thatyou build
a string such as :

C:\WebSites\Site52\Sites\SiteRootHere\..\WriteHere

You could also have this info in the web.config file...

Patrice

--

"Kenny" <a@b.com> a écrit dans le message de
news:ua**************@TK2MSFTNGP09.phx.gbl...
If MapPath is the way to go, then how can I reference the desired folder as relative to the current site's root (I don't want to hard-code the path from the C:\root folder). FWIW the logic that does the read/writing is in a
middle tier component (not in a code-behind module).

Suppose I need to write to the WriteHere folder:

C:\WebSites\Site52\WriteHere\

and the site root is elsewhere:
C:\WebSites\Site52\Sites\SiteRootHere\

Thanks for helping.

Nov 19 '05 #2

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

Similar topics

5
by: Dica | last post by:
i've followed the instructions i found here about how to add a config file to my applicaiton: http://www.c-sharpcorner.com/Code/2003/Nov/CreateUseConfigFiles.asp the instructions state that i...
1
by: John | last post by:
Hi We have the html portion of our site in the site root folder on a remote site hosted with a web hosting company. I am now trying to add some asp.net bits to the site but in trying to keep...
0
by: Kenny | last post by:
I need to read/write .jpg files in a folder *above* the current site's root. If MapPath is the way to go, then how can I reference the desired folder as relative to the current site's root (I don't...
2
by: §iD` | last post by:
Hi! I would like to create a virtual folder (which I want to mount) and populate managing his content by a DLL or something like that in VB.NET (2.0). How can I acomplish this? Thanks to...
3
by: Greg | last post by:
I like the Web hosting site I'm using (though alternate hosting suggestions are welcome), and it allows me to point mulitple domains to the root folder for free, but it charges extra for pointing...
6
by: ManagedCoder | last post by:
Hi, My requirement is as follows: I need to set the HttpExpires (enable content expiration - set to 7 days) on a folder within a virtual directory. I have been able to set the HttpExpires...
0
by: deco12 | last post by:
Hi, I am new to web design and Apache, but have managed to password protect my site by putting a .htaccess file in the sites root directory. I have set it up so that a number of members have...
0
by: alivip | last post by:
Is python provide search in parent folder contain sub folders and files for example folder name is cars and sub file is Toyota,Honda and BMW and Toyota contain file name camry and file name corola,...
5
by: IUnknown | last post by:
Ok, we are all aware of the situation where modifying the folder structure (adding files, folders, deleting files, etc) will result in ASP.NET triggering a recompilation/restart of the application....
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...
0
Oralloy
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,...
0
jinu1996
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...
1
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.