You could use the wp_mail function https://developer.wordpress.org/reference/functions/wp_mail/ to send an email to anyone after the file is successfully uploaded in your directory. You do not need any action here
Add it your code after the file is uploaded successfully
if(empty($errors)==true){
move_uploaded_file($file_tmp,"/$user_dirname/".$document);
echo "The file was uploaded successfully!";
wp_mail(..);
}else{
print_r($errors);
}
}
Related Posts:
- WordPress upload file action hook
- Intercept request to /wp-content/uploads/random.file
- wp.media add context
- Hook to get image filename when it is uploaded
- File names are being overridden when uploading new media
- Change the look of the media uploader
- Featured image to grayscale with PHP imagefilter – which hook to use?
- Making Site A Use Site B’s wp-content Folder
- How to generate thumbnails when needed only?
- Trouble understanding apply_filters()
- Media files exist in upload folder but not showing up
- Set limit to media upload?
- Save camera info as metadata on image upload?
- How to upload SVG in WordPress 4.9.8?
- add_action(‘wp_ajax_[action name]’, myfunction) problem
- Use a separate custom table (not posts) to handle file upload data
- PNG with transparent background turns black when uploaded and resized
- What is the earliest possible hook for safely using `is_front_page`?
- WP 3.3 > Still no option to enable automatic image overwrites?
- Custom upload directory per CPT; when removed, file not deleted
- How can I log a user out of WordPress before the page loads?
- How to get all files inserted (but not attached) to a post
- Trigger JS when featured image upload window is opened in admin
- uploading files to the uploads folder via ftp
- Delete images uploaded by ‘Subscriber’ role
- Remove upload_files capability from a role but allow role to manage an avatar image
- 3.5 media manager add CSS / JS to new ‘tab’ iframe content
- Please explain me what the do_action does
- Insert Featured image from Feed
- http error when uploading media files
- How can I upload a csv file into WordPress?
- How to link to the image editor’s Edit Image function?
- Use latest jQuery in WordPress (admin interface)
- What hook should be used to programmatically create a post only when master post is updated?
- Saving WordPress generated thumbnails in a subdirectory
- Whole bunch of errors on WP website – media upload, edit slugs, edit screen not working [closed]
- Is there an action hook that fires just before a template is loaded?
- What are the benefit in adding hook in the init() hook?
- Insert Image automatically when upload finishes wordpress media uploader
- How to change the order (priority) of registered filters (or actions) (e.g. for the_content)?
- WordPress “HTTP error.” when uploading Media – IIS
- Where to hook my plugin’s action
- WordPress uploads folder path. how it is decided?
- Limit upload file type on one custom post type
- How do action and filter hooks understand where to look for the core function that we hooked our function to them
- Filter / Hook to get attachment ID before uploading?
- PDF file upload issue
- Looking for a hook for post.php
- Which action does wp_update_user triggers?
- Update image via WP REST API
- media_handle_upload() progress bar
- Prefixing plugin hooks (actions/filters) with a wrapper class or functions
- Trigger a custom function when option are saved in admin area
- ‘An error occurred in the upload. Please try again later.’ for users with different roles
- Set post_parent value for the images uploaded by Add Media button into post
- What are best practices to storing uploads in WordPress?
- How to display message (with switch_theme hook) after deactivating My theme?
- What conditions must be met in order to upload .zip file to a multisite WordPress installation?
- What action hook can I use to add a JavaScript to a page post using a theme template that is not including get_header() nor get_footer()?
- Is it possible to add the_content filter upon login?
- Using Add from Server to upload by post ID
- Image resizing – TimThumb vs convert on upload?
- Patient portal using wordpress
- Why do plugins often ask to add in to templates?
- Stop image resizing in particular case – is that possible?
- Is it safe to upload JSON files to upload folder?
- How to catch wordpress post ID when it’s published
- Get The Caller (Plugin / Theme / Core) For All actions & Hook in WordPress
- Advanced WordPress plugin activation detection
- “Trying to upload files larger than” error will not go away
- Adding custom Bulk Actions
- How to add filetype to meta value when using wp_upload_bits?
- Cropping thumbnails to specific dimensions on front end post
- Double slash in upload URLs
- Unable to upload new file as a product
- Make inline uploader (plupload) on options page upload to a specific folder
- WordPress blog with a custom made theme hosted on heroku
- media file uploading
- WordPress Plugin Boilerplate – add actions and/or filters based on user’s role
- What is wrong with my wp_insert_attachment code?
- {status}_{post_type} does not run correctly?
- taxonomy_edit_form_fields output after term fields
- Set attachment category from file name on upload
- HTTP Error WordPress on IIS uploading image
- add_option_{$option} action hook not being called
- WordPress Upload Speed
- _d_improd_ directory in uploads breaking site images
- Move jQuery on *top* of footer
- Drag and Drop Media Not Working in Windows 10 Edge Browser
- do action inside a class is not working
- Exclude some photos in media library
- Failed to load resource at admin screen
- Upload more than one media files with a post
- How to handle image resize in media_handle_sideload?
- Image uploaded in media library, can only see it when I using the WP Edit Image feature. 404 when trying to view in browser
- Single file upload
- Insert plugin html content to a specific spot in the frontpage
- Updating Media Library PDF’s in bulk
- Assign multiple categories to Media Library upload
- Update media item using wordpress rest api in python