How to make file upload field mandatory in Jquery

How to make the file upload field mandatory in Jquery?

 

var file1 = $("#file_1").val();
        if (file1 == '') {
            $("#file_1").focus();
            return false;
        }

2021-10-03