It sounds like the web server doesn't know where your page is relative to
the web directory. What does this return?
protected void Page_Load(object sender, EventArgs e)
{
string sFullPath =Server.MapPath(@"DocTemp\TestDoc.doc");
if (new System.IO.FileInfo(sFullPath).Exists)
{
sFullPath = sFullPath.Replace(@"\", @"/");
Response.Write(sFullPath);
}
}
"JJ" <jj****@hotmail.com> wrote in message
news:11*********************@g14g2000cwa.googlegro ups.com...
I have the following code running in a test asp.net app locally on my
xp system and I can't get the FileInfo.Exist to recognize that the file
is in the folder defined in code. What do I need to set in order for
this to work?
string sFullPath = @"\DocTemp\TestDoc.doc";
if(new FileInfo(sFullPath).Exists)
{
sFullPath = sFullPath.Replace(@"\", @"/");
}
JJ