Ok, so first edit the file joomla_flash_uploader.php in the com_joomla_flash_uplaoder folder.
You want to change the showFlashComponent function to look like this...
Code:
function showFlashComponent($id) {
$user =& JFactory::getUser(); //my mod********************************
$database = &JFactory::getDBO();
$row = new joomla_flash_uploader($database);
$row->load($id);
if ($row->id == null) { // no profile found or no id!
HTML_joomla_flash_uploader::wrongId($id);
} else {
$uploadfolder = $row->folder;
$uploadfolder = "path/to/files/".$user->username; //My mod *******************************************
// we go back to the main folder!
if ($uploadfolder == "") {
$folder = "./../../../..";
} else {
$folder = "./../../../../" . $uploadfolder;
}
JFUHelper::setJFUSession($row, $folder);
unset($_SESSION["IS_ADMIN"]);
$_SESSION["IS_FRONTEND"] = "TRUE";
JFUHelper::fixSession();
HTML_joomla_flash_uploader::showFlash( $row, $uploadfolder );
}
}
Obviously change the path/to/files to something sensible. This will now ignore what you set in the backend and will now point to path/to/files/username
next you need to change the joomla_flash_uplaoder.html.php file in the same directory. Add the following somewhere early in the show flash function.
Code:
$user =& JFactory::getUser();
if (!file_exists($realfolder) && $realfolder != "") { //my mod *************************************************
mkdir($realfolder);
$output .= 'The destination folder does not exist, creating new folder... ';
$output .= 'If this is not your first upload then contact an administrator';
}
So this checks to see if the folder exists, and if not then it makes it.
Simple!