diff --git a/public_html/includes/class/class.LSformRule_filesize.php b/public_html/includes/class/class.LSformRule_filesize.php
index 89752155..cdcce2cb 100644
--- a/public_html/includes/class/class.LSformRule_filesize.php
+++ b/public_html/includes/class/class.LSformRule_filesize.php
@@ -39,9 +39,10 @@ class LSformRule_filesize extends LSformRule {
* @return boolean true si la valeur est valide, false sinon
*/
public static function validate ($value,$options,$formElement) {
- $file = LSsession :: getTmpFile($value);
-
- $size = filesize($file);
+ // According to PHP doc, strlen() returns the number of bytes rather
+ // than the number of characters in a string.
+ // See: https://www.php.net/manual/en/function.strlen.php
+ $size = strlen($value);
$maxSize = LSconfig :: get('params.maxSize', null, 'int', $options);
if (is_int($maxSize) && $size > $maxSize)