I need to show a modal message like "Uploaded file exceeds X MB" when the user tries to upload a large file.
I have set maximum size in the field settings and when I try to upload a large file Drupal shows a label with custom error.
I need to trap this event and launch the js
with modal message.
I have a;
function hook_file_validate($file) {
....
}
It is invoked in ajax so I cannot make a drupal_add_js
call with the javascript code to execute.
How can I execute JS method for solving this problem?