FileByteCount
FileByteCount[file] gives the number of bytes in a file.
Examples
Get file size:
FileByteCount["document.pdf"]
(* 1048576 *)Human-readable size:
FileByteCount["image.png"] / 1024.0
(* 256.5 kilobytes *)Please visit the official Wolfram Language Reference for more details.