Hi, here are instructions for the free version:
1. Create an additional field where the user will insert the name.
2. Install a 3rd party plugin, called Code Snippets. It will be used for implementing the filters.
3. Go to the Dashboard page of Code Snippets and add a new snippet. Give it any name you want.
4. Add the following code inside the Code Box:
if (!function_exists('wfu_before_file_check_handler')) {
function wfu_before_file_check_handler($changable_data, $additional_data) {
$filepath = wfu_basedir($changable_data["file_path"]);
$fileext = wfu_fileext($changable_data["file_path"], true);
$new_filename = sanitize_file_name(trim($changable_data["user_data"][0]["value"]));
if ( $new_filename != "" ) $changable_data["file_path"] = $filepath.$new_filename.$fileext;
else $changable_data["error_message"] = "File not uploaded! Invalid name entered.";
return $changable_data;
}
add_filter('wfu_before_file_check', 'wfu_before_file_check_handler', 10, 2);
}
The above filter will replace the filename with the name entered in the field. It will check the entered name for invalid characters. If it is empty, then the upload will fail.
5. Save and Activate the filter.
Nickolas