Hi,
I am running straight ASP and not ASP.NET.
I have a page which lists a bunch of project numbers each with an href link
to an Excel file whose name is project number.xls on the server. I want to
check if the file exists, if it does enable the link else disable the link.
I have the following code.
<%
dim strProj
function findFile(strProj)
Dim objFSO, objFolder
Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
Set objFolder = objFSO.GetFolder("../busops/prog")
For Each strProj in objFolder.Files
If strFile.Name = strNumber Then
findFile = strProj.Name
Else
findFile = null
End If
Next
Set objFolder = Nothing
Set objFSO = Nothing
end function
%>
<%
strProj = trim(oRsMOIE("ProjectNum"))
if findFile(strProj) = null then
%>
<td colspan="2" align=center><a href="#"><%=oRs("ProjectNum")%></a></td>
<%
else
%>
<td colspan="2" align=center><a href="<%="MIP/" &
trim(oRsMOIE("ProjectNum")) & ".xls"%>"><%=oRsMOIE("ProjectNum")%></a></td>
<%
end if
%>
I get an path not found error on the GetFolder line.
Any help would be greatly appreciated.
Is the fileExists only available for .NET? If so, how else I would check for
the file?
Is it because browse directory listing permission is not granted in IIS? If
so, how else I can check if the file exists? I am not allowed to grant browse
directory listing permission.
Thanks much.