cffm.cffm
Component cffm (cffm)


Configuration data and methods for CFFM


hierarchy: WEB-INF.cftags.component
      cffm.cffm
path: /home/webworksllc/public_html/cffm/cffm.cfc
properties: allowedExtensions, cffmFilename, debug, disallowedExtensions, editableExtensions, enableImageDimensionsInDirList, iconPath, includeDir, includeDirWeb, maxImageDimensionsPerFileListing, overwriteDefault, templateWrapperAbove, templateWrapperBelow
methods: checkExtension, checkSubdirValue, copyDirectory*, createFile, createServerPath, createVariables, createWebPath, deleteDirectory, deleteFile, directoryList, forceNumeric, getDirectoryMetadata, getDirectorySeparator, getMimeType, getPathInfo, getPathType, init, moveDirectory*, readFile, renameFile, saveFile, unzipFile, viewZipFile
* - private method

Property Hint Type Req. Implemented In Default Value
allowedExtensions Extensions that are allowed to be uploaded. Overrides disallowedExtensions for increased security. Useful if you only want people to upload images. String cffm
cffmFilename Filename used by the file manager, if other than "cffm.cfm" string cffm cffm.cfm
debug Specifies whether or not debug output will be generated. boolean cffm false
disallowedExtensions Extensions that are not allowed to be uploaded. This also affects files being unzipped from a zip archive. String cffm
editableExtensions File extensions that specify editable files. String cffm
enableImageDimensionsInDirList Whether or not to determine and show image dimensions in file listing boolean cffm true
iconPath Path to the icons used by CFFM. string cffm ./cffmIcons
includeDir Physical directory path to the main directory which CFFM has access to. string cffm -
includeDirWeb The logical web path to the directory specified by the includeDir property. String cffm -
maxImageDimensionsPerFileListing ONLY display up to this many image dimensions per file listing. Limitation is for performance reasons. numeric cffm 20
overwriteDefault Default value for the overwrite existing files checkbox in various CFFM forms. boolean cffm true
templateWrapperAbove File that will be cfincluded above all CFFM output. Should include CFFM specific CSS. string cffm above.cfm
templateWrapperBelow File that will be cfincluded below all CFFM output. string cffm below.cfm


checkExtension
public boolean checkExtension ( required string ext )

Checks an extension against the configured list of allowed and disallowed extensions.

Output: suppressed
Parameters:
   ext: string, required, ext

checkSubdirValue
public string checkSubdirValue ( required string checkValue, string defaultValue="[runtime expression]" )

Make sure the subdir parameter, which determines hte current working directory, is valid and within the acceptable directory structure.

Output: enabled
Parameters:
   checkValue: string, required, checkValue
   defaultValue: string, optional, defaultValue

copyDirectory*
private boolean copyDirectory ( required string Source, required string Destination, boolean Recurse="False", boolean OverWrite="True", boolean calledItself="False" )

Copy a directory, optionally recursing into subdirectories and optionally overwriting existing files.

Output: enabled
Parameters:
   Source: string, required, Source
   Destination: string, required, Destination
   Recurse: boolean, optional, Recurse
   OverWrite: boolean, optional, OverWrite
   calledItself: boolean, optional, calledItself

createFile
public struct createFile ( required string filename, required string filetype )

Create a blank file or directory.

Output: suppressed
Parameters:
   filename: string, required, filename
   filetype: string, required, filetype

createServerPath
public string createServerPath ( required string subdir, string filename="" )

Giving a specified subdir value and a filename, generate a physical server path to the file.

Output: suppressed
Parameters:
   subdir: string, required, subdir
   filename: string, optional, filename

createVariables
public Struct createVariables ( required Struct scopeVariables, required Struct scopeForm, required Struct scopeUrl, required String varList )

Sets specified variable names from form, url, or variables scoped variables, and applies a default value if the variable is undefined.

Output: suppressed
Parameters:
   scopeVariables: Struct, required, scopeVariables
   scopeForm: Struct, required, scopeForm
   scopeUrl: Struct, required, scopeUrl
   varList: String, required, varList

createWebPath
public string createWebPath ( required string subdir, string filename="" )

Giving a specified subdir value and a filename, generate a URL link to the file.

Output: suppressed
Parameters:
   subdir: string, required, subdir
   filename: string, optional, filename

deleteDirectory
public Struct deleteDirectory ( required string directory, boolean Recurse="False" )

Delete a directory, and optionally delete its contents.

Output: enabled
Parameters:
   directory: string, required, directory
   Recurse: boolean, optional, Recurse

deleteFile
public struct deleteFile ( required string deleteFile )

Delete a file.

Output: suppressed
Parameters:
   deleteFile: string, required, deleteFile

directoryList
public query directoryList ( required string directory, boolean recurse="false", query dirInfo, query thisDir )

List the contents of a directory, optionally recursing into subdirectories. This was implemented due to inconsistencies between Coldfusion and Bluedragon.

Output: enabled
Parameters:
   directory: string, required, directory
   recurse: boolean, optional, recurse
   dirInfo: query, optional, dirInfo
   thisDir: query, optional, thisDir

forceNumeric
public Struct forceNumeric ( required Struct scopeVariables, required String varList )

Forces specified variables within the variables scope to be numeric values. This is required for certain variables when interacting with the java image library.

Output: suppressed
Parameters:
   scopeVariables: Struct, required, scopeVariables
   varList: String, required, varList

getDirectoryMetadata
public struct getDirectoryMetadata ( required query dirlist )

Gets meta data for a directory listing - number of files and number of directories.

Output: suppressed
Parameters:
   dirlist: query, required, dirlist

getDirectorySeparator
public string getDirectorySeparator ( )

Output: suppressed

getMimeType
public string getMimeType ( required string filename )

Output: suppressed
Parameters:
   filename: string, required, filename

getPathInfo
public string getPathInfo ( required Struct scopeCgi )

Output: suppressed
Parameters:
   scopeCgi: Struct, required, scopeCgi

getPathType
public string getPathType ( required string pathValue )

Determines if a string is a directory or file path. Returns an empty string if the path does not exist.

Output: suppressed
Parameters:
   pathValue: string, required, pathValue

init
public void init ( required string includeDir, required String includeDirWeb, String disallowedExtensions="", String allowedExtensions="", String editableExtensions="", boolean overwriteDefault="true", string iconPath="./cffmIcons", numeric debug="0", string templateWrapperAbove="above.cfm", string templateWrapperBelow="below.cfm", string cffmFilename="cffm.cfm", string enableImageDimensionsInDirList="true", string maxImageDimensionsPerFileListing="20" )

Output: suppressed
Parameters:
   includeDir: string, required, includeDir
   includeDirWeb: String, required, includeDirWeb
   disallowedExtensions: String, optional, disallowedExtensions
   allowedExtensions: String, optional, allowedExtensions
   editableExtensions: String, optional, editableExtensions
   overwriteDefault: boolean, optional, overwriteDefault
   iconPath: string, optional, iconPath
   debug: numeric, optional, debug
   templateWrapperAbove: string, optional, templateWrapperAbove
   templateWrapperBelow: string, optional, templateWrapperBelow
   cffmFilename: string, optional, cffmFilename
   enableImageDimensionsInDirList: string, optional, enableImageDimensionsInDirList
   maxImageDimensionsPerFileListing: string, optional, maxImageDimensionsPerFileListing

moveDirectory*
private boolean moveDirectory ( required string Source, required string Destination, boolean OverWrite="True" )

Move a directory to a new location, and optionally overwrite existing files.

Output: enabled
Parameters:
   Source: string, required, Source
   Destination: string, required, Destination
   OverWrite: boolean, optional, OverWrite

readFile
public struct readFile ( required string filename )

Read the contents of a file.

Output: suppressed
Parameters:
   filename: string, required, filename

renameFile
public struct renameFile ( required string oldFile, required string newFile, action="rename", overWrite="false" )

Rename or move a file OR directory, optionally overwriting existing files/directories.

Output: suppressed
Parameters:
   oldFile: string, required, oldFile
   newFile: string, required, newFile
   action: any, optional, action
   overWrite: any, optional, overWrite

saveFile
public struct saveFile ( required string filename, required string fileContent )

Save a text file.

Output: suppressed
Parameters:
   filename: string, required, filename
   fileContent: string, required, fileContent

unzipFile
public unzipFile ( required string zipFilePath, string outputPath="", overWrite="false" )

Unzip a specified zip file to a optionally specified output path (defaults to the same directory) and optionally overwrite existing files.

Output: suppressed
Parameters:
   zipFilePath: string, required, zipFilePath
   outputPath: string, optional, outputPath
   overWrite: any, optional, overWrite

viewZipFile
public query viewZipFile ( required string zipFilePath )

View the contents of a specified zip file.

Output: suppressed
Parameters:
   zipFilePath: string, required, zipFilePath