Re-saving an existing file will not change its status.

I don't know, what this is supposed to mean. Changing the status with file_save() works fine, and the documentation of file_save_upload() even explicitly tells you to do so:

To make the file a permanent file, assign the status and use file_save() to save the changes.

Attached patch would delete this line. Otherwise, could someone explain to me what it should mean? Then we can perhaps make the docu clearer.

CommentFileSizeAuthor
file_save-docu.patch643 bytesdrunken monkey

Comments

dawehner’s picture

Status: Active » Reviewed & tested by the community

Looks fine. If file_save is called again, this code will be runned

    drupal_write_record('file_managed', $file, 'fid');

and the file_managed table has the status key.

dries’s picture

Status: Reviewed & tested by the community » Fixed

Committed to CVS HEAD. Thanks.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.