=== modified file 'includes/file.inc' --- includes/file.inc 2010-02-01 19:07:07 +0000 +++ includes/file.inc 2010-02-10 07:01:44 +0000 @@ -1242,6 +1242,12 @@ } } + // Save the file as permanent if it's not being moved to the temporary:// + // scheme. + if (file_uri_scheme($file->uri) != 'temporary') { + $file->status |= FILE_STATUS_PERMANENT; + } + // If we made it this far it's safe to record this file in the database. if ($file = file_save($file)) { // Add file to the cache.