How to validate file is selected or not on ajax processed jquery validation I am trying to do jquery validation on file upload for file is select or not. I want when user click on upload before submit check file is selected or not. if not stop ajax request. Any Idea to validate it?

$videoForm['profile_photos']['images']['field_photo'] = array(
    '#parents' =&gt; array('video', 'field_photo'),
    '#id' =&gt; 'field_photo',
    '#type' =&gt; 'managed_file',
    '#title' =&gt; 'Photo &lt;em&gt;(optional)&lt;/em&gt;',
    '#field_name' =&gt; 'field_photo',
    '#process' =&gt; array(
    'm_customer_profile_image_remove',
    'm_customer_profile_image_upload',          
    'file_managed_file_process',
        'customer_profile_image_preview',
    ),
    '#upload_location' =&gt; 'public://' . $user-&gt;uid,
    '#limit_validation_errors' =&gt; array(array('video', 'field_photo')),
    '#upload_validators' =&gt; array(
        'file_validate_size' =&gt; array(64*1024*1024),
        'file_validate_extensions' =&gt; array('gif jpeg jpg png')
    )
);
What are you using for the file upload element? Is this in a form, webform etc.? With the Form API managed_file should do what you want.