Get total size of file in bytes [duplicate] December 2, 2022 by Tarik You can use the length() method on File which returns the size in bytes.