diff --git a/S3.php b/S3.php index 0b1564b2..6ec64b8c 100644 --- a/S3.php +++ b/S3.php @@ -561,6 +561,7 @@ public static function inputFile($file, $md5sum = true) self::__triggerError('S3::inputFile(): Unable to open input file: '.$file, __FILE__, __LINE__); return false; } + clearstatcache(false, $file); return array('file' => $file, 'size' => filesize($file), 'md5sum' => $md5sum !== false ? (is_string($md5sum) ? $md5sum : base64_encode(md5_file($file, true))) : ''); } @@ -634,8 +635,10 @@ public static function putObject($input, $bucket, $uri, $acl = self::ACL_PRIVATE if (isset($input['size']) && $input['size'] >= 0) $rest->size = $input['size']; else { - if (isset($input['file'])) + if (isset($input['file'])) { + clearstatcache(false, $input['file']); $rest->size = filesize($input['file']); + } elseif (isset($input['data'])) $rest->size = strlen($input['data']); }