Change file to permant status

WE HAVE MOVED!

Please visit our new Drupal Website at https://www.xenyo.com我們的新網頁設計公司網頁.

<?php
function modulename_siteconfig_validate($form , $form_state) {
  if(!empty($form_state['values']['image']) {
    $f = file_load($form_state['values']['image']);
    $f->status =1;
    $foutput = file_save($f);
    file_usage_add($foutput, 'modulename', 'modulename', $foutput->fid);  /*** ****/
  }
}
?>
Help Share this Article