Hi,
The action wfu_after_file_upload can be used to perform some php actions after a file has been uploaded. Although I do not think that this is your case, here is an example of how to use it:
these are the steps:
1. first implement wfu_before_file_upload filter from where you can get the filepath and the unique_id of the file that is uploaded. For instance, put the following code somewhere inside your plugin:
add_filter(‘wfu_before_file_upload’, ‘wfu_before_file_upload_handler’, 10, 2);
function wfu_before_file_upload_handler($file_path, $file_unique_id) {
//store filepath in database with a unique id
update_option(‘wfu_uploads_’.$file_unique_id, $file_path);
// Add more code here if needed
return $file_path;
}
2. Then implement wfu_after_file_upload to check if the file has been uploaded successfully and then perform some action
add_action(‘wfu_after_file_upload’, ‘wfu_after_file_upload_handler’, 10, 4);
function wfu_after_file_upload_handler($file_unique_id, $upload_result, $error_message, $error_admin_messages) {
if ( $upload_result == ‘success’ ) {
//retrieve the filepath from the database
$filepath = get_option(‘wfu_uploads_’.$file_unique_id);
//perform any php actions here
}
}
The above will execute php code internally in the web server (server-side). If you want some action to show up on the screen of the user who made the upload (client-side), then this would require some client-side / server-side communication and execution of javascript code. Unfortunately I haven’t implemented something like this yet but it is on its way in the next release.