To get the extension (i.e pdf, asp, doc etc) out of a filename string I am using this function which bascially searches for the last dot and then returns what's coming thereafter:
<%
Function IncGeneral_GetExtension( sFileName )
if sFileName = "" Then Exit function
if InStr(1, sFileName, ".") = 0 Then Exit function
IncGeneral_GetExtension = Right(sFileName, Len(sFileName) - InStrRev(sFileName, ".") )
End Function
%>
Example:
<%
Response.Write (IncGeneral_GetExtension("hej.asp"))
%>
Gives you "asp"