diff options
author | hashworks <mail@hashworks.net> | 2017-07-10 20:38:34 +0200 |
---|---|---|
committer | Florian Pritz <bluewind@xinu.at> | 2017-07-11 10:20:05 +0200 |
commit | 5674bd05d10a91c1e70d03fed419379b7a5ed0c8 (patch) | |
tree | 5c9dbfacbb0b6fd46ea612b55b21a75f225e425d /application/controllers/file/file_default.php | |
parent | b253c9a893077711e503c69970b24ae94e7451ac (diff) |
Actually update filesize with update_file_metadata
According to `application/controllers/tools.php#L32` the `update_file_metadata` tool should update the mimetype AND the filesize, but the latter never got implemented.
Diffstat (limited to 'application/controllers/file/file_default.php')
-rw-r--r-- | application/controllers/file/file_default.php | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/application/controllers/file/file_default.php b/application/controllers/file/file_default.php index f4f106990..9ef7d0880 100644 --- a/application/controllers/file/file_default.php +++ b/application/controllers/file/file_default.php @@ -971,11 +971,14 @@ class File_default extends MY_Controller { foreach ($query as $key => $item) { $data_id = $item["hash"].'-'.$item['id']; - $mimetype = mimetype($this->mfile->file($data_id)); + $filepath = $this->mfile->file($data_id); + $mimetype = mimetype($filepath); + $filesize = filesize($filepath); $this->db->where('id', $item['id']) ->set(array( 'mimetype' => $mimetype, + 'filesize' => $filesize, )) ->update('file_storage'); } |