
On a few occasions now, I’ve been asked whether it’s possible for the Desktop Media Uploader for Umbraco package could be made to support custom folders, to which, unfortunatley, the current answer is no. Rather than explain the reasons why every time the question pops up, I just thought I’d write a quick blog post instead.
1. Umbraco media has no “Folder” concept
The first reason is that Umbraco doesn’t really have the concept of a “Folder”. In Umbraco Folders and Files are the same, they are all just Media Types with differing “allowed child media types”. Ok, so I could check all media types to see if they allow sub media types, but that leads me on to reason 2.
2. Desktop Media Uploads are created File first
When uploading a file via Desktop Media Uploader, the server automatically works out what Media Type to create a media item based upon it’s extension. The problem with this is that that it’s not until the file is uploaded that you would be able to discover whether the file can actually be created in the desired location. By only supporting the “Folder” Media Type, we don’t have that problem, as the “Folder” type can handle all Media Types, or, if it can’t, we can be sure at a bare minimum it can support the “File” Media Type as a fall back. With a custom folder, it could be possible to have no fall back media type, leaving us no option to deny the upload and report an error.
3. Folders don’t exist
The final reason, and this is more to do with the actual uploading of folders, is the fact that folders don’t actually have any physical attributes to be able to discover how to handle them. With files, we can check the file extension, and decide how to handle it, but with folders, that’s not possible. Team this then with “File first” upload issue mentioned above, and you can really start to get into a mess. What if you upload a folder that is not allowed in that location? All files in that folder would fail, and it would require the user to then log in to the CMS and rectify the issue.
I’m pretty sure that these things may be possible to fix, but the point of Desktop Media Uploader has always been to suite the largest majority of Umbraco users, and to not over complicate the process. I have made it extendable by supporting custom Media Types for files, but in my honest opinion, supporting custom folders just isn’t worth the payoff.
That said, Desktop Media Uploader is an open source package, and users are more than welcome to look at implementing this themselves, and if anyone was to do this, I’d be more than happy to review the code and merge the changes in if feel they don’t compromise the current functionality.
http://dmu4umb.codeplex.com/SourceControl/list/changesets
Happy uploading.

For a long time,