Index: /FCKeditor.Java/branches/2.4/src/main/java/net/fckeditor/ConfigurationHandler.java
===================================================================
--- /FCKeditor.Java/branches/2.4/src/main/java/net/fckeditor/ConfigurationHandler.java	(revision 1320)
+++ /FCKeditor.Java/branches/2.4/src/main/java/net/fckeditor/ConfigurationHandler.java	(revision 1321)
@@ -24,4 +24,6 @@
 import java.io.IOException;
 import java.util.Properties;
+
+import net.fckeditor.tool.Utils;
 
 import org.slf4j.Logger;
@@ -186,3 +188,19 @@
 	return defaultProperties;
     }
+    
+    /**
+     * Getter for the sub dir name of a media type.
+     * 
+     * @param type
+     * @return The sub dir name of the requested type, or the default one ('file') 
+     * 		if 'type' is unknown or empty.
+     */
+    public static String getSubDirForType(final String type) {
+	String defaultSubDir = getDefaultProperty("fckeditor.subdir.media.file");
+	if (Utils.isEmpty(type))
+	    return defaultSubDir;
+	String subDir = getDefaultProperty("fckeditor.subdir.media.".concat(type.toLowerCase()));
+	
+	return (Utils.isEmpty(subDir)) ? defaultSubDir : subDir;
+    }
 }
Index: /FCKeditor.Java/branches/2.4/src/main/java/net/fckeditor/connector/ConnectorServlet.java
===================================================================
--- /FCKeditor.Java/branches/2.4/src/main/java/net/fckeditor/connector/ConnectorServlet.java	(revision 1320)
+++ /FCKeditor.Java/branches/2.4/src/main/java/net/fckeditor/connector/ConnectorServlet.java	(revision 1321)
@@ -310,9 +310,8 @@
     }
 
-    // TODO move to ConfigurationHandler?
     private String constructTypeBasedFolderString(final String fileType, final String currentFolderString) {
 	StringWriter retval = new StringWriter();
-	retval.append(ConfigurationHandler.getBaseDir()).append('/');
-	retval.append(fileType.toLowerCase());
+	retval.append(ConfigurationHandler.getBaseDir());
+	retval.append(ConfigurationHandler.getSubDirForType(fileType));
 	retval.append(currentFolderString);
 	return Utils.replaceAll(retval.toString(), "//", "/");
