com.sebtools Build 1 Documentation: FileMgr.cfc

FileMgr.cfc

FileMgr.cfc helps to manage file locations and ensure all folders for storing files exist.

To initialize FileMgr, use the following code (Where "UploadPath" is a variable with the server path to the folder in which you want to store all of your uploaded files):

Application.FileMgr = CreateObject("component","FileMgr").init(UploadPath)

The following methods are the most commonly used in FileMgr:

deleteFile(FileName,Folder)
Deletes the file.
getDirectory(Folder)
Gets the full system path for the given folder.
getFileLen(FileName,Folder)
Gets the length file.
getFilePath(FileName,Folder)
Gets the full system path for the given file.
makeFolder(Folder)
Makes the given folder, if it doesn't already exists.
readFile(FileName,Folder)
Returns the contents of the file.
uploadFile(FieldName,Folder[,NameConflict])
Uploads the file (tied to a Form).
writeFile(FileName,Contents,Folder)
Write the contents to the file.

CFC Docs

Blog Entries