From 5674bd05d10a91c1e70d03fed419379b7a5ed0c8 Mon Sep 17 00:00:00 2001 From: hashworks Date: Mon, 10 Jul 2017 20:38:34 +0200 Subject: 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. --- application/controllers/file/file_default.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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'); } -- cgit v1.2.3-24-g4f1b