Use asp's instrrev to get the last position, and then intercept it. You can test it yourself. In fact, the programming process also involves a lot of testing, and you will slowly discover more good things.
Copy the code as follows:<%
'Function: Get the file extension
Function getFileExt(sFileName)
getFileExt = Mid(sFileName, InstrRev(sFileName, .) + 1)
End Function
%>