php - Uploaded files are getting deleted in Drupal? -


i have administer drupal website, didn't set , honestly, haven't experience drupal yet.

but have serious problem: if upload file (it's pdf) not attached node, deleted every few hours. apparently, need indicate permanent manually file overview page.

is there way set permanent automatically?

hope can me! thanks!

you need set status parameter on file object use file_save save it:

// first obtain file object, example file_load... $file = file_load(10);  // or example, result of file_save_upload... $file = file_save_upload('upload', array(), 'public://', file_exists_replace);  // can set status $file->status = file_status_permanent;  // , save status. file_save($file); 

Comments

Popular posts from this blog

c# - How to get the current UAC mode -

postgresql - Lazarus + Postgres: incomplete startup packet -

javascript - Ajax jqXHR.status==0 fix error -