image disappears which uploaded with managed_file type I have implemented a configuration page which is at admin panel. It is something like this:

  $form["footer"]['xyz_cust_image'] = array(
    '#type' =&gt; 'managed_file',
    '#title' =&gt; t('Image title'),
    '#default_value' =&gt; variable_get('xyz_cust_image'),
    "#description" =&gt; t("Image description"),
    '#required' =&gt; TRUE,
    '#upload_location' =&gt; 'public://',
    '#upload_validators' =&gt; array(
      'file_validate_extensions' =&gt; array('gif png jpg jpeg')
    )
  );


but have a different situation. the thing is I successfully upload image and it is appearing when i upload it at the browser for that day. When the day passed, the image disappears. When I looked to variable table, the record exists; but the image not appears.
Drupal prunes files that haven't been explicitly marked as permanent. This happens on a cron job, which explains the delay you're seeing.

To avoid this, you need to add a submit handler to your form which updates the status of the file. e.g.

MYMODULE_some_form_submit($form, &amp;$form_state) {
  $file = file_load($form_state['values']['xyz_cust_image']);
  $file-&gt;status = FILE_STATUS_PERMANENT;
  file_save($file);
}