I have a media video content type that has a video file field (takes a file), name, and air date. The video files are saved on amazon S3 not locally.
I want to monitor the files that are uploaded and get an email (that has the file name, file size, and URL) every time a file of 100MB or more is uploaded even before the node is saved when the user is still on the add/edit form.
How can I do that I looked into hook_entity_insert
and file_presave
or another option?
But I am a bit confused as to which one will be the best and how to implement it.
hook_file_validate()
. Though if this is a standard Drupal file field it might be preemptive to send an email before entity save in case the user decides to switch the file before entity save?