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

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 4772
On 25 Dec 2006 01:26:43 -0800, "pappu" <gu*************@gmail.comwrote:
>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.
This is an ASP.NET question.

Please post it at: microsoft.public.dotnet.framework.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
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...
8
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...
8
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...
19
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...
3
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...
14
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...
2
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....
1
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...
4
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...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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...

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.