473,782 Members | 2,513 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Server.MapPath( "~")

txtUpload1.Post edFile.SaveAs(S erver.MapPath(" ~") + "\\" + file1.Name);

this code loads the file in the root directory of my application, by using
the tilde. How do I accomplish getting the file to loaded above root. My
application is within another applilcation (subdomain). I guess I am looking
the .net equivalent to .. in unix.

Thanks.
Nov 17 '05 #1
4 9416
I could not understand what u mean but i think

Request.Physica lApplicationPat h
Request.Physica lPath
Request.Current ExecutionFilePa th
Request.Applica tionPath

can help u

--

Thanks,
Yunus Emre ALPÖZEN
BSc, MCAD.NET

"ramonred" <ra******@discu ssions.microsof t.com> wrote in message
news:18******** *************** ***********@mic rosoft.com...
txtUpload1.Post edFile.SaveAs(S erver.MapPath(" ~") + "\\" + file1.Name);

this code loads the file in the root directory of my application, by using
the tilde. How do I accomplish getting the file to loaded above root. My
application is within another applilcation (subdomain). I guess I am
looking
the .net equivalent to .. in unix.

Thanks.

Nov 17 '05 #2
Hello

System.IO.Path. GetDirectoryNam e returns the parent directory of a file or
directory.

Best regards,
Sherif

"ramonred" <ra******@discu ssions.microsof t.com> wrote in message
news:18******** *************** ***********@mic rosoft.com...
txtUpload1.Post edFile.SaveAs(S erver.MapPath(" ~") + "\\" + file1.Name);

this code loads the file in the root directory of my application, by using
the tilde. How do I accomplish getting the file to loaded above root. My
application is within another applilcation (subdomain). I guess I am
looking
the .net equivalent to .. in unix.

Thanks.

Nov 17 '05 #3
The .Net equivalent to ".." is ".."

The problem is, .Net will not let you access a directory outside of your
application.

Imagine that you website is on a shared server at a web hosting
provider. Allowing you to do what you are trying here, could let you hack
other people's website.

--
--
Truth,
James Curran
[erstwhile VC++ MVP]

Home: www.noveltheory.com Work: www.njtheater.com
Blog: www.honestillusion.com Day Job: www.partsearch.com

"ramonred" <ra******@discu ssions.microsof t.com> wrote in message
news:18******** *************** ***********@mic rosoft.com...
txtUpload1.Post edFile.SaveAs(S erver.MapPath(" ~") + "\\" + file1.Name);

this code loads the file in the root directory of my application, by using
the tilde. How do I accomplish getting the file to loaded above root. My
application is within another applilcation (subdomain). I guess I am looking the .net equivalent to .. in unix.

Thanks.

Nov 17 '05 #4
James is Right,

..Net will now allow u to access outside from your VD. and i think you are
trying to go one directory up then your root Directory.

Thanks
Ritesh

"ramonred" wrote:
txtUpload1.Post edFile.SaveAs(S erver.MapPath(" ~") + "\\" + file1.Name);

this code loads the file in the root directory of my application, by using
the tilde. How do I accomplish getting the file to loaded above root. My
application is within another applilcation (subdomain). I guess I am looking
the .net equivalent to .. in unix.

Thanks.

Nov 17 '05 #5

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

Similar topics

1
2888
by: bonnie.tangyn | last post by:
Hello all I get Too few parameters expected 2 error and "The MS Jet Database engine cannot find the input table or query "myTempTablename". Make sure it exists and that its name is spelled correctly. 3078" after I migrated "MS Access 2000" to "MS SQL Server 2000" and relinked all linked tables. The front-end interface of my application is MS Access 2000. The back-end is MS SQL Server 2000. After I migrated the database and
3
6211
by: Mikkky | last post by:
The sample code below returns and error " The type or namspace name 'Server' could not be found". Please help. using System;using System.IO; using System.Xml;using System.Diagnostics; using System.Collections;using System.Web;using System.Web.UI; using System.Web.UI.WebControls;using System.Web.UI.HtmlControls; public class Business { XmlDocument doc = new XmlDocument(); doc.Load(Server.MapPath("Rules.xml"));
1
1823
by: Jim Heavey | last post by:
Hello, I am trying out how to programatically figure out where my datafile is. I thought I could use Server.MapPath to provide me the name of where my webpage is located, as I have used that in other situations, but this situation is different. My web pages and data file do not reside on the same drive as where the server resides, so Sever.MapPath is propbably not the right method. How do I find the path where my actual web page is...
2
3799
by: Tee | last post by:
Hi, I am currently using Server.MapPath in my aspx files, but because of I am using it more than once, I would like to move these code away from aspx and make it as a public function inside Module, but I am having problem with it. As "Server.MapPath" is not allow in other .vb file ... can anyone help with this ? or if we really can't make it, is there any other way could do it ? Thanks,
0
1277
by: Jim Moon | last post by:
Hello. We have SQL Server Stored Procedures that use the "CURRENT_USER" variable. We have SQL Server database fields that call "user_name()" as a default. That has been fine in the use and storage of user names, in the context of being called from IIS 5 and 6, from ASP 3.0 using ADODB. I'll add that the web applications are using Basic Authentication. So, individual user account names are garnered and stored. That is valuable to us.
2
3051
by: Jim Moon | last post by:
Hello. We have SQL Server Stored Procedures that use the "CURRENT_USER" variable. We have SQL Server database fields that call "user_name()" as a default. That has been fine in the use and storage of user names, in the context of being called from IIS 5 and 6, from ASP 3.0 using ADODB. I'll add that the web applications are using Basic Authentication. So, individual user account names are garnered and stored. That is valuable to us.
10
9045
by: Kenneth P | last post by:
Hi all, I have an Access database and try to create a connection to it using the Server.MapPath method. I have the app lib in c:\inetprub\wwwroot\apps\myApp and the database in c:\inetpub\dbq\myDB. Using Server.MapPath("../../../dbq/myDB") should as I understand it take me to the myDB lib. But instead I get an error message saying "Cannot use a leading .. to exit above the top directory."
1
1906
by: ae | last post by:
is the prope way to read xml files, as long as they are on my server, but how do i access them from other sites, such as http://www.site.com/xmltoread.xm
5
9625
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
0
9639
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9479
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,...
0
10146
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
9942
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8967
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
7492
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...
1
4043
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3639
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2874
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.