Randy, this works for me:
savePath.aspx
-------------------------------
<%@ Page Language="C#" %>
<script language = "C#" runat="server">
void Page_Load(Objec t Sender, EventArgs e)
{
String fileName = "a.txt";
String sSaveLocation = Server.MapPath( "PFPDocs") + "\\" + fileName;
Label1.Text = sSaveLocation;
}
</script>
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Retrievi ng a FilePath</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:Label ID="Label1" Runat="server" Text=""></asp:Label>
</div>
</form>
</body>
</html>
---000---
That returns : C:\Inetpub\wwwr oot\test\PFPDoc s\a.txt
I don't see why it shouldn't work for you.
Try running just that page (savePath.aspx) , and see what it returns.
That should make your sleuthing easier.
Does the directory "wwwroot\PFPApp \PFPDocs" exist ?
Juan T. Llibre
ASP.NET MVP
http://asp.net.do/foros/
Foros de ASP.NET en Español
Ven, y hablemos de ASP.NET...
=============== =======
"Randy" <te**@temp.co m> wrote in message news:uF******** ******@TK2MSFTN GP15.phx.gbl...
Yes, I'm doing that...here's the line from below...
sSaveLocation = Server.MapPath( "PFPDocs") + "\\" + fileName;
But, like I said, the error message doesn't show any slashes in it...strange
"Juan T. Llibre" <no***********@ nowhere.com> wrote in message
news:u1******** *****@TK2MSFTNG P12.phx.gbl... If you use C#, you must double the slashes
in order for one of them to show.
Check your fileName code and put double slashes "\\"
wherever you have a single slash "\".
Juan T. Llibre
ASP.NET MVP
http://asp.net.do/foros/
Foros de ASP.NET en Español
Ven, y hablemos de ASP.NET...
=============== =======
"Randy" <te**@temp.co m> wrote in message news:OY******** ******@TK2MSFTN GP14.phx.gbl... Hello All,
I'm getting a strange error when trying to perform a file upload. Here's the lines
that uploads the file...
sSaveLocation = Server.MapPath( "PFPDocs") + "\\" + fileName;
fileInput.Poste dFile.SaveAs(sS aveLocation);
When it runs, I'm getting a "Access to the path xxx is denied" error. On the server
(Server 2003) I've given the ASP.NET and Everyone Full Control but still I get the
error. I've also given IUSR_machinenam e Full Control and I still get the error.
One thing that is strange and I'm not sure if it's a problem, when the error is
reported in the dialog, it states that...
Access to the path "C:Inetpubwwwro otPFPAppPFPDocs MyFile.xls" is denied
In the above error the "\"'s are not in there. I'm not sure if this is the reason it
won't upload the file or if it is a permissions thing.
Thanks