Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 5 Next »

File

Formtools provides a simple file upload option. File field types need to be used in conjunction with a string data type. The formtool expects to store the path to a file media asset in the database field.

Save locations are relative to the system application default file path. The reason for this is to accommodate both open (ie. under the webroot) and secure (ie. under the project root and reached by download.cfm or similar controller) file storage deployments.

Attribute

Description

Default Value

ftStyle

Inline style attributes.

(blank)

ftDestination

Location of file; relative to the default file root.

(blank)

ftSecure

Whether or not the file storage should use the secure or open file path for storage

false

File Paths

File formtool refers to application.path.secureFilePath and application.path.defaultFilePath for the absolute file paths to store uploaded files. You can change these values in your project's ./config/_serverSpecificVars.cfm

Often the default file path points directly to ./www/files. Make sure you don't include /files in your ftDestination or you'll end up with something like ./www/files/files

Best Practice

A common best practice is to nominate a destination path that includes the typename and propertyname. For example, for a content type called "dmproposal" and a property of "pdfcoverpage" you might use ftdestination="/dmproposal/pdfcoverpage"

Sample Usage

<cfproperty
  ftSeq="25" 
  ftfieldset="Cover Page" 
  ftWizardStep="Overview" 
  name="pdfCoverPage" 
  type="string" 
  hint="PDF cover page to merge." 
  required="no" 
  default="" 
  ftlabel="PDF Cover Page" 
  fttype="file" 
  ftDestination="/dmproposal/pdfcoverpage" />
  • No labels