Drupal 7 node form processing cleaner Below is an example of adding an additional submit handler to a node form. I don't like how in the submit handler I have a giant nested structure just to check if a file was uploaded...Is there a better way?

&lt;?php
function rocdocs_polygons_form_polygons_node_form_alter(&amp;$form, &amp;$form_state, $form_id)
{
    $form['#submit'][] = 'rocdocs_polygons_form_polygons_node_form_submit';
}

function rocdocs_polygons_form_polygons_node_form_submit($form, &amp;$form_state)
{
    if ($form_state['values']['field_shapes_file']['und'][0]['fid'])
    {

    }
}
If you want to inspect the values of a submitted form, I'm afraid you'll have to dig in to a nested array.

However, if you need to check if a file has been uploaded, why don't you make it a required field? And if you have a reason to write your own check, why don't you add a validation function instead of a submit handler?