Hide Uploaded Files in File Field in Node Edit Form I have a custom content type, Contacts. Under contacts I have a custom File field, Contracts.

I want to hide the any file that have been uploaded under the File Field, Contracts in the node edit form. It should be view-able only by the admin.

I want to display the upload option in the field to all the users, however, not the files that have already been uploaded under the node.

Please advice

Thanks

The modified code:

MODULE NAME = Hide_Uploaded_Files.

CONTENT TYPE = Candidates.

CUSTOM fIELD = field_resume.

&lt;?php
function Hide_Uploaded_Files_form_alter(&amp;$form, &amp;$form_state, $form_id) {
global $user;    
if ($form_id === 'Candidates_node_form' &amp;&amp; !in_array('administrator', $user-
&gt;roles) &amp;&amp; $form['field_resume']['und'][0]['#default_value']['fid'] &gt; 0) {
$form['field_resume']['#access'] = FALSE;   
}
}
?&gt;
Create a custom module and implements hooK_form_alter(). and set field access to false for other user except administrator.


function MODULENAME_form_alter(&$form, &$form_state, $form_id) {
  global $user;    
  if ($form_id === 'CONTENTTYPE_node_form' && !in_array('administrator', $user->roles) && $form['field_image']['und'][0]['#default_value']['fid'] > 0) {
    $form['field_image']['#access'] = FALSE;    
  }
}


MODULENAME = Your costom module machine name.
CONTENTTYPE = Your content type machine name.
field_image = Your custom file field machine name.