validating the Uploaded Image name in Image field of Content type I need to validate the Image Name uploaded via Image field in Content type.How can i validate the Image name.

Any Help is Appreciated

Thanks,
function hook_form_alter(&amp;$form, &amp;$form_state, $form_id){
    if($form_id == "YOUR_FORM_ID"){
        $form['#validate'][] = 'myvalidation_function';
    }
}

function myvalidation_function($form, &amp;$form_state) {   
    $file_fid = $form['field_your_content_type_image_field']['LANGUAGE_NONE'][0]['#value'][fid];
    $file = file_load($file_fid);
    $file_name = explode( '.', $file-&gt;filename);    
    if($file_name[0] != $form['type']['#value']){
        drupal_set_message('your validation error');
    }
}


Hope this works. I have tested on my system :)