The Server.MapPath method maps the specified relative or virtual path to the corresponding physical directory on the server.
Questions tagged [server.mappath]
131 questions
0
votes
1 answer
Getting path to subproject's Content folder
Currently I have a main (root) ASP.NET MVC project that sits at the base, while all the subprojects are added as references. I'd like to use the subproject's Content folder, but unfortunately Server.MapPath, and Content.Url keeps giving me the root…

matt
- 2,857
- 7
- 33
- 58
0
votes
2 answers
Getting XslCompiledTransform.Load to load a file in a SharePoint List
I'm having difficulties getting XslCompiledTransform.Load method to take a server path. I googled around and found that I need to do something like:
xslt.Load(System.Web.HttpContext.Server.MapPath(xslPath),
XsltSettings.Default, new…

BeraCim
- 2,317
- 8
- 49
- 78
0
votes
2 answers
Server.MapPath() not getting specific folder
i am trying to save an image file in my WebApplication folder but its not working
Here is the directory map
wwwroot
-
-
-----RegApp
- -
- ----Images
-
-
-----RegService
i am saving file from WebService(RegService) into…

AddyProg
- 2,960
- 13
- 59
- 110
0
votes
3 answers
System.Web.UI not giving me the MapPath
I am working on a mailSender Class. I can't use the Server.MapPath method from the System.Web.UI Namespace. What reference should i set to make this work? I have referenced to the System / System.Web / System.Web.UI.
This is the msdn i have…

Younes
- 4,825
- 4
- 39
- 66
0
votes
1 answer
Can't use Server.MapPath
I'm trying to use Server.MapPath instead of the complete path which basically looks like this
CsvFile= @"D:\web\finalsa\en\csr\download_center\Click_Counter.csv";
The file where i write this line is located in…
user1173169
0
votes
2 answers
How to extract name/data from database and use it as my folder name which is created dynamically in asp.net c# using server.MapPath()?
I have used AjaxFileUpload to upload multiple image files. Now i want to store the uploaded images inside rootfolder>subfolder.
The rootfolder is in the name of the user.
The rootfolder is created dynamically by taking the session of the user who…

user2106271
- 179
- 1
- 1
- 3
0
votes
1 answer
Where do my images go when i use FileUpload1.SaveAs(Server.MapPath())?
Originally I started having the images put into a database and using generic handler to view the images, it was ok for one part of my app but then I realized that storing images in the database wasn't going to work out to well for a part of my…

Chris
- 2,953
- 10
- 48
- 118
0
votes
1 answer
Calling Server.MapPath from .cs file
I'm trying to write my errors into the text file in my MapPath.
But i have a problem it is :
path = Server.MapPath("~/emails.txt");
Actually Server is in System.Web.UI.Page namespace and I want to Use it in my cs file which has no aspx file... I …

amin
- 1,194
- 1
- 12
- 20
0
votes
1 answer
What is wrong with this file path?
Hai guys,
I have two folders called CSVLoad and Forms... I have an aspx page inside forms folder which has a fileupload control. I save my uploaded file to my CSVLoad folder i gave the following path
FileUpload1.SaveAs(Server.MapPath("CSVLoad//" +…

ACP
- 34,682
- 100
- 231
- 371
0
votes
2 answers
Image.FromFile FullURL is not working
First, let me give codes
1)
if (dt.Rows.Count.ToString() != "0")
{
resimm = dt.Rows[0]["resim"].ToString();
}
else
{
resimm = "UserFiles/Image/no_image.jpg";
}
System.Drawing.Image orjinalFoto =…

Burak Benli
- 39
- 2
- 8
0
votes
2 answers
Delete file using querystring and name from database
I'm trying to create a delete-page for the user to delete a selected image-files in a photoalbum. I just don't know how to select the database table row "navn" ("name" in english) using an url querystring.
Should I make a new SqlConnection and…

chmodder
- 184
- 1
- 3
- 17
0
votes
1 answer
500 internal server error on asp.net page caused probably by server.MapPath
I am trying to use swfupload to upload file to the server. The photo upload worked perfectly fine on the development machine but when i tried to check it on production server. there was 500 internal server error. Checking the exception details the
…

Spirals Whirls
- 543
- 1
- 8
- 27
0
votes
1 answer
Server.MapPath() misses one level
We have a .Net application, and we have three exactly same copies of it. One for development on our server, and a test and a live one on our client's server.
We have to create pdf files on the server, and save them in a specified folder.
It works…

Gomez0
- 41
- 2
0
votes
0 answers
How to get the path of the parent deploy folder
My application needs files outside Deploy folder And I would like to know how to set The Path with Server.MapPath("").
This is not a valid solution for me :
var FullTempPath ="C:\inetpub\TempFiles" ;
Example:
C:\inetpub\ProjectFolder >…

user1520494
- 1,134
- 2
- 11
- 27
0
votes
2 answers
How to give path of a folder in server to save an image?
I'm trying to store an image into two applications (both published on server). This is my code to save the image :
string path = Server.MapPath("/Images/Landing/bottom_banner/");
string path1 =…

nitinvertigo
- 1,180
- 4
- 32
- 56