filesystem method plugin... etc.


quick question. what would be the best way to create a directory
within my includes directory from a plugin? I'm creating a plugin that
uploads docs to the filesystem, and I wanna be able to check if a
directory exists before creation under the includes directory? Should
I just use an expandPath('../includes/newFolder') or is there some
nifty way Coldbox handles filesystem functions?

I wanna make this plugin platform independent so I want something that
would work on multiple filesystems...

any thoughts?

You can use the setting: getSetting(“ApplicationPath”)

That gives you the full physical path to your application root. Then you can use “/” forward slashes as your delimiter for folders, as they will be converted by the JVM to real paths in whatever OS it is running under.


awesome! thanks... does anyone know if <cfdirectory> creates
recursively? (I know it's more of a CF question than Coldbox) :wink:

is there a sample anywhere using the uploadFile() method of the
Utilities plugin? I'm trying to find a reference where a file upload
fails using this method...

any thoughts?

cfdirectory will recurse in cf7+, but not in 6.1