diff --git a/lib/private/largefilehelper.php b/lib/private/largefilehelper.php
index 33f32255f3b5f783c1c3400dff50edf2f0912707..750ba1d23de9a2ae26eb3f3f8e33a00d08b74abc 100644
--- a/lib/private/largefilehelper.php
+++ b/lib/private/largefilehelper.php
@@ -151,7 +151,7 @@ class LargeFileHelper {
 			$result = null;
 			if (strpos($os, 'linux') !== false) {
 				$result = $this->exec("stat -c %s $arg");
-			} else if (strpos($os, 'bsd') !== false) {
+			} else if (strpos($os, 'bsd') !== false || strpos($os, 'darwin') !== false) {
 				$result = $this->exec("stat -f %z $arg");
 			} else if (strpos($os, 'win') !== false) {
 				$result = $this->exec("for %F in ($arg) do @echo %~zF");