Hello All, I hope someone can help me with the following. In my ASP script I want to check if a certain file exists on the webserver. Therefore I use a script with an function that will check the file in question. Now the funny thing is that if the file to check is in the same directory where the ASP script is that it works fine, when it is in another directory (level) it wont work. Can anyone tell me what I';m doing wrong? Here's the code: <% Dim FileName FileName = MyRecordSet("articlearticlenumber") & ".pdf" 'This one wont work FileName = Server.MapPath("/") & "</>" & "/files/ArticleManuals/" & FileName 'This one works. FileName = (Server.MapPath(FileName)) If IsFileExists(FileName) = True Then %> 'This is the function part ' ********************************** ' Function to check file Existance ' ********************************** Function IsFileExists(byVal FileName) If FileName = "" Then IsFileExists = False Exit Function End If Dim objFSO Set objFSO = Server.CreateObject("Scripting.FileSystemObject") If (objFSO.FileExists( FileName )) = True Then IsFileExists = True Else IsFileExists = False End If Set objFSO = Nothing End Function %> The ASP script is in the following directory C:\webserver\Site\asppage.asp The file to check is in the following directory C:\webserver\site\sitefiles\manuals Thanks again, Peter
try to change: FileName = Server.MapPath("/") & "</>" & "/files/ArticleManuals/" & FileName with just FileName = Server.MapPath("/files/ArticleManuals/" & FileName)