Adobe 38043740 - ColdFusion Standard - Mac Development Manual page 1257

Developing applications
Hide thumbs Also See for 38043740 - ColdFusion Standard - Mac:
Table of Contents

Advertisement

DEVELOPING COLDFUSION 9 APPLICATIONS
Using External Resources
View directory information
Create a ColdFusion page with the following content:
1
<html>
<head>
<title>List Directory Information</title>
</head>
<body>
<h3>List Directory Information</h3>
<cfdirectory
directory="c:\inetpub\wwwroot\mine"
name="mydirectory"
sort="size ASC, name DESC, datelastmodified">
<table cellspacing=1 cellpadding=10>
<tr>
<th>Name</th>
<th>Size</th>
<th>Type</th>
<th>Modified</th>
<th>Attributes</th>
<th>Mode</th>
</tr>
<cfoutput query="mydirectory">
<tr>
<td>#mydirectory.name#</td>
<td>#mydirectory.size#</td>
<td>#mydirectory.type#</td>
<td>#mydirectory.dateLastModified#</td>
<td>#mydirectory.attributes#</td>
<td>#mydirectory.mode#</td>
</tr>
</cfoutput>
</table>
</body>
</html>
2
Modify the path C:\inetpub\wwwroot\mine so that it points to a directory on your server.
3
Save the file as directoryinfo.cfm in the myapps directory under your web_root and view it in the browser.
Using cfcontent
The cfcontent tag downloads files from the server to the client. You can use this tag to set the MIME type of the content
returned by a ColdFusion page and, optionally, define the name of a file for the current page to download. By default,
ColdFusion returns a MIME content type of text/html so that a web browser renders your template text as a web page.
As with the
and
cffile
cfdirectory
About MIME types
A MIME type is a label that identifies the contents of a file. the browser uses the MIME type specification to determine
how to interact with the file. For example, the browser could open a spreadsheet program when it encounters a file
identified by its MIME content type as a spreadsheet file.
tags
you can disable processing in the ColdFusion Administrator.
,
Last updated 1/20/2012
1252

Advertisement

Table of Contents
loading

This manual is also suitable for:

Coldfusion 9

Table of Contents