469,917 Members | 1,435 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,917 developers. It's quick & easy.

Determine if File Exists

I am trying to determine if a file exists on a web site but I cannot get a
match. I have verified that the file does exists in the specified directory
(I verified the case of the file and directory name). The code (below) is
from one of my aspx pages. Is there something here I overlooked?

Wayne

======================= code =======================
If File.Exists(Server.MapPath("./scores/" & strCurrEventID & ".pdf")) Then

btnViewScores.Enabled = True

End If
Nov 21 '05 #1
2 1581
Wayne,

"Wayne Wengert" <wa***********@wengert.org> schrieb:
I am trying to determine if a file exists on a web site but I cannot get a
match. I have verified that the file does exists in the specified directory
(I verified the case of the file and directory name). The code (below) is
from one of my aspx pages.
[...]
======================= code =======================
If File.Exists(Server.MapPath("./scores/" & strCurrEventID & ".pdf")) Then


Did you already check the string returned by 'Server.MapPath'?

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Nov 21 '05 #2
Herfried;

Thanks for the response. I did check that value. I just found that there was
some strange character after the "jpg" on the server. I deleted the file,
uploaded it again and now it works.

Wayne

"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
Wayne,

"Wayne Wengert" <wa***********@wengert.org> schrieb:
I am trying to determine if a file exists on a web site but I cannot get a
match. I have verified that the file does exists in the specified
directory (I verified the case of the file and directory name). The code
(below) is from one of my aspx pages.
[...]
======================= code =======================
If File.Exists(Server.MapPath("./scores/" & strCurrEventID & ".pdf"))
Then


Did you already check the string returned by 'Server.MapPath'?

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Nov 21 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

7 posts views Thread by Kamus of Kadizhar | last post: by
2 posts views Thread by OvErboRed | last post: by
6 posts views Thread by Opie | last post: by
7 posts views Thread by Stephen E. Weber | last post: by
28 posts views Thread by Tim Daneliuk | last post: by
1 post views Thread by Waqarahmed | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.