Adobe 38043740 - ColdFusion Standard - Mac Development Manual page 265

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

Advertisement

DEVELOPING COLDFUSION 9 APPLICATIONS
Developing CFML Applications
Operation
Tag used
Create
cfdirectory
action="create"
The
attribute can
directory
only take the path of the
bucket. Any additional path
results in an error.
All other attributes are
ignored. While creating S3
bucket, the default bucket
location is
US
. You can
change the location using the
attribute
storeLocation.
storeLocation
attribute added to the
cfdirectory
tag.
You can specify ACL for the
bucket while creating it using
the
attribute
storeACL
which takes a struct value. For
details, see
"Setting up access
control" on page 261.
List keys
cfdirectory
action="list"
Delete
cfdirectory
action="delete"
Note: To verify if the bucket exists and is accessible, use the function
Object operations
All object operations are similar to file operations (read, write, copy, and delete). Therefore, the tag
file functions can be used to perform the operations. The following table describes the common scenarios:
Operation
Tag used
Read
cffile
action="read"
Write
cffile
action="write
Delete
cffile
action="delete"
Copy
cffile
action="copy"
Function
Example
<cfdirectory action="create" directory="s3://bucket1"/>
DirectoryC
reate
is a new
DirectoryL
<cfdirectory action="list" directory="s3://bucket1/X/y"
/>
ist
Since Amazon S3 does not have the concept of directory, it returns the key
name (that is, the full path) of objects contained in the bucket.
Directory
in which objects have to be searched. The path that follows the bucket name
is used as a prefix to perform the list operation and all the objects that match
the prefix are returned.
In this case, the following attributes are ignored:
DirectoryD
<cfdirectory action="delete" directory="s3://bucket1"/>
elete
Function
Example
<cffile action="read" file="s3://testbucket/test.txt"
FileRead
variable="data"/>
FileWrite
<cffile action="write" output="#data#"
file="s3://testbucket/test.txt"/>
"
<cffile action="delete" file="s3://testbucket/test.txt"/>
FileDelete
FileCopy
<cffile action="copy" source="s3://testbucket/test.txt"
destination="s3://bucket2/a/b.txt"/>
Last updated 1/20/2012
attribute in this case takes the path, for example,
.
directoryExists
260
s3://bucket1
,
, and
recurse
type
sort.
and the
cffile

Advertisement

Table of Contents
loading

This manual is also suitable for:

Coldfusion 9

Table of Contents