Using IsImage()


Is 'default.asp an image? False
Is 'folder.gif an image? True
Is 'jakes_IO.zip an image? False
Is 'text.html an image? False
Is 'title.png an image? True

Contents of default.asp :
<!-- The includefile is one level back from the "default.asp" file: -->
<!--#include file ="../../jakes_IO.asp"-->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html lang="da">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <title>Example use of the IsImage function</title>
    <link rel="stylesheet" type="text/css" href="/jake.css">
</head>
<body>
    <div align="center"><h1>Using IsImage()</h1></div>

    <br>
    <span class="sample">

    <!-- ***************    HERE IS WHERE IT HAPPENS!!     ****************** -->
    <%
    dim file
    for each file in getFilesFromFolder(".")
        response.write("Is '" & file & " an image? " & isImage(file) & "<br>")
    next    
    %>
    <!-- ********************************************************************** -->
    </span>
    
    <p><b>Contents of default.asp :</b><br>
    <span class="source">
    <% response.write(stringToHTML (GetFileContents("default.asp")))%>
    </span>

</body>
</html>