Summary - MACROMEDIA COLFUSION MX 7-GETTING STARTED BUILDING COLDFUSION MX Getting Started

Building coldfusion mx applications
Table of Contents

Advertisement

Reviewing the code
The following table describes the code used to verify whether the photo file exists:
Code
<cfset PhotoLocation =
"C:\CFusionMX7\wwwroot\cfdocs\
getting_started\photos\">
<cfset PhotoLocation =
PhotoLocation
<cfif not
FileExists(PhotoLocation)>
<cfset isOk = "No">
<cfoutput>
Trip Photo does not exist.
</cfoutput>
</cfif>

Summary

As described in this lesson, ColdFusion offers a number of alternatives to validating data. If you
are familiar with standard page validation code, ColdFusion supports these development
approaches. However, ColdFusion form tags simplify data validation. In this lesson, you also
dynamically populated a list.
In the next lesson
Now that you are sure that your application can save valid data, in the next lesson, you will write
code to add trips to the database. Additionally, you will add logic to update existing trip data in
the Trips table.
122
Chapter 10: Lesson 7: Validating Data to Enforce Business Rules
Explanation
The
the appropriate directory.
Note: The code snippet shows one value for Windows
systems.
The ColdFusion & operator in the
& FORM.photo>
directory name with the name of the photo file entered in the
form.
FileExists
fileLocation
it doesn't, an error message appears.
tag sets the value of the PhotoLocation path to
cfset
checks to see if the file indicated by the
variable exists at the specified disk location. If
tag combines the
cfset

Advertisement

Table of Contents
loading

This manual is also suitable for:

Colfusion mx 7 - installing and using coldfusion mx

Table of Contents