What value is mdl_files.size, and how is it converted to KB on the restorefile.php page?
by Matthew Willis -
Number of replies: 2
In reply to Matthew Willis
Re: What value is mdl_files.size, and how is it converted to KB on the restorefile.php page?
by Colin Fraser -
mmm I've thought of file sizes as more like guidelines rather than hard and fast rules. It doesn't matter the environment, file sizes vary depending on the viewing format, I've found. You have two different views here, the Course backup area Size and the database size, What would it be if you downloaded it and had a look in your file manager, or in a DOS window or a terminal window, the results would likely be different, I suggest. However, I would also suggest it is rounded to the nearest kb in the php file that writes the page.
In reply to Colin Fraser
Re: What value is mdl_files.size, and how is it converted to KB on the restorefile.php page?
by Matthew Willis -
It's reading as a 7KB file, so you're right. Can you confirm the column stores the data as bytes? I've guessed it has, but can't find anything in the schema that confirms this. If it does, then I'm happy to use my existing conversion (to mebibityes) as below:
select f.filesize/1048576 'filesize in MB'-- 1 Mebibyte = 1048576 bytes
from mdl_files f
where (f.component = 'user' and f.filearea = 'backup')
or (f.component = 'backup' and f.filearea = 'course')