CF uploaded does not create directories as specified in the docs
|Reported by:||sirmeili||Owned by:|
|Component:||Server : ColdFusion||Version:||FCKeditor 2.4|
The docs clearly state that directories for user files will be created when needed. While this does work for the file browser, it does now work for the uploaded. To fix this you need to add this code:
<cfif not directoryExists(currentFolderPath)>
<cfdirectory action="create" directory="#currentFolderPath#"/>
after this line of code on about line 93 of the upload.cfm file in /filemanager/upload/cfm/
<cfset currentFolderPath = userFilesServerPath & url.type & fs>
Please note that this is probably a quick fix and will create the whole directory structure if non existant. For example if you accidentally put 'useFiles' instead of 'Userfiles' it will create the folder 'useFiles'. This is the nature of the cfdirectory tag as it will create the whole path. If you want it to merely create the directory in the last of the list (for example the 'Image' in 'Userfiles/Image' I can create that code for you and have it throw and error if the 'UserFiles' directory is non existant.
I however find this needless since the directory structure should not be dynamic (with the exception of user directories, which i like the method I used since it only created the user directory when that user stores a file and doesn't force me to create a user directory when that user is created).