Removing the upload button in managed files I want to save a image file  into my custom content type using forms api and node_save().

The below code works fine but I also get the upload button as it default in managed_file .

I don't want the upload button. So I tried type=file but it did not work. How can I remove the upload button ? 

Also if you just select the file and submit the form it works so I really need to just find a way to remove the upload button. 

$form['image'] = array(
    '#type' =&gt; 'managed_file',
    '#title' =&gt; 'File',
    '#upload_location' =&gt; 'public://my-files/'
);
The work to separate out the managed_file element is done in file_managed_file_process(), which is the default #process function for that type of element.

To hide the upload button you need to implement your own simple #process function for the element:

function MYMODULE_my_form($form, &amp;$form_state) {
  $form['image'] = array(
    '#type' =&gt; 'managed_file',
    '#title' =&gt; 'File',
    '#upload_location' =&gt; 'public://my-files/',
    '#process' =&gt; array('MYMODULE_my_file_element_process')
  );

  return $form;
}

function MYMODULE_my_file_element_process($element, &amp;$form_state, $form) {
  $element = file_managed_file_process($element, $form_state, $form);
  $element['upload_button']['#access'] = FALSE;
  return $element;
}