473,809 Members | 2,718 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to get virtual path of a folder indepent of where tht folder resides.

Hello friends,

I have one folder Named as MainFolder on server. I have one more
folder named as subfolder inside tht main folder.Now I want to save
some pictures in tht folder but at runtime I m not getting correct
virtual path of tht folder. As Server.MapPath( ) & MapPath methods
returns physical path.So How I can Access tht folder independent of
where my application is insatlled.
I have used following metthods but it doesnt work,

Server.MapPath( ".//subfolder");
MapPath("~/subfolder");
Request.MapPath (".//subfolder");

Thxxxxxxx,
Sachin.

Dec 25 '06 #1
2 4794
On 25 Dec 2006 01:26:43 -0800, "pappu" <gu************ *@gmail.comwrot e:
>Hello friends,

I have one folder Named as MainFolder on server. I have one more
folder named as subfolder inside tht main folder.Now I want to save
some pictures in tht folder but at runtime I m not getting correct
virtual path of tht folder. As Server.MapPath( ) & MapPath methods
returns physical path.So How I can Access tht folder independent of
where my application is insatlled.
I have used following metthods but it doesnt work,

Server.MapPath (".//subfolder");
MapPath("~/subfolder");
Request.MapPat h(".//subfolder");

Thxxxxxxx,
Sachin.
This is an ASP.NET question.

Please post it at: microsoft.publi c.dotnet.framew ork.aspnet

Good luck with your project,

Otis Mukinfus
http://www.arltex.com
http://www.tomchilders.com
Dec 25 '06 #2
Server.MapPath has access only inside the context (virtual directory)
otherwise you need to know the exact path. Unless your asp.net thread
is running under a user that can traverse your directory structure.

pappu wrote:
Hello friends,

I have one folder Named as MainFolder on server. I have one more
folder named as subfolder inside tht main folder.Now I want to save
some pictures in tht folder but at runtime I m not getting correct
virtual path of tht folder. As Server.MapPath( ) & MapPath methods
returns physical path.So How I can Access tht folder independent of
where my application is insatlled.
I have used following metthods but it doesnt work,

Server.MapPath( ".//subfolder");
MapPath("~/subfolder");
Request.MapPath (".//subfolder");

Thxxxxxxx,
Sachin.
Dec 26 '06 #3

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

Similar topics

0
1392
by: Joe | last post by:
I've been running into problems when trying to create a Virtual FTP folder in ASP.Net. I've tried it a few ways but none of them has worked so far. I have identity impersonation turned on, and the current user is an administrator on the machine, so I wouldn't think it's a permissions issue, but I can't think of anything else that it might be. The first way I tried, which worked fine in ASP but not ASP.Net, is: Dim Path Dim ftpSvc Dim...
8
2236
by: And | last post by:
Hi everyone my database is in a folder inside the inetpub folder (c:\inetpub\bd\mydatabase.mdb) and my web application is in a folder inside the wwwroot folder. My question is: Is there a way of accessing my database using virtual directories, that is, for example if I was using html I could achieve this putting "..\..\bd\mydatabase.mdb".
8
3403
by: nick | last post by:
I have a problem and I've been using a cheezy work around and was wondering if anyone else out there has a better solution. The problem: Let's say I have a web application appA. Locally, I set it up as C:\domains\appA. Locally, my IIS root points to C:\domains. I don't point it to C:\domains\appA since if I have an appB under C:\domains I wouldn't be able to get to it. So to access it via my browser I go to localhost/appA.
19
10243
by: Steve Franks | last post by:
I am using VS.NET 2005 beta 2. When I run my project locally using the default ASP.NET Development Web Server it runs using a root address like this: http://localhost:11243/testsite/ However when I deploy to a remote test server running real IIS, the real root of my application becomes: http://localhost/ What I want to do is have it so that on my local machine the asp.net dev
3
1529
by: Dhruba Bandopadhyay | last post by:
In classic ASP I could write: <!-- #INCLUDE VIRTUAL="Kevin\General\ServiceClass.asp" --> and it would "include" that ASP file into the current ASP file. My web application folder was not stored in C:\Inetpub\wwwroot\ but somewhere else. But the VIRTUAL command let IIS locate files by the IIS virtual folder. Now in ASP.NET this does not work. It complains saying:
14
12734
by: Lorenzo | last post by:
Hello, I have a web application with a virtual directory in it. With 'virtual directory' i mean a folder whose physical path is different from the physical path of the application, but in which Web Sharing is active. For example: my application is in "C:\Inetpub\wwwroot\MyApp", the Virtual folder is in "C:\VirtualFolder", and IIS sees it as if it were in "C:\Inetpub\wwwroot\MyApp\VirtualFolder".
2
28982
by: somaskarthic | last post by:
Hi In my php page my i'm displaying a image. The image resides in the same location where the php page resides. when i refer other image src other than in the document root , it is not working. /var/www/html is the document root. My php page and the image resides in var/www/html folder. I could access it as http://localhost/mypage.php. It displays the image and working fine. If i refer it from some other folder like /var/imagefolder/,...
1
3814
by: gujarsachin2001 | last post by:
Hello friends, I have one folder Named as MainFolder on server. I have one more folder named as subfolder inside tht main folder.Now I want to save some pictures in tht folder but at runtime I m not getting correct virtual path of tht folder. As Server.MapPath() & MapPath methods returns physical path.So How I can Access tht folder independent of where my application is insatlled. I have used following metthods but it doesnt work,
4
3344
by: tshad | last post by:
I have a site www.stf.com and a site www.stfstage.com (where I do all my testing). The problem is that www.stfstage.com is only internal and I need to get access from the outside (without creating a new domain). I tried to create a Virtual directory inside my stf site so that I would access it like: www.stf.com/stage/. I run as www.stfstage.com fine and have for a long time.
0
10639
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, 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...
0
10376
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 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...
0
9200
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7661
isladogs
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...
0
6881
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();...
0
5550
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...
0
5688
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3861
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3015
bsmnconsultancy
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...

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.