amazon-s3-php-class
amazon-s3-php-class copied to clipboard
inputFile() problem
inputFile() method uses php is_readable() funcion. Results from this function are cached. See http://www.php.net/manual/en/function.is-readable.php
So I had to include a call to clearstatcache() php function before is_readable() call. http://www.php.net/manual/pt_BR/function.clearstatcache.php.
My problem was because a batch file execution which try to read file names from database and copy from one directory to a S3 bucket. When file is not found in directory, the execution waits some seconds and try to read it again.
Maybe inputFile() should have an extra parameter to bypass it... But you could just call putObject() with an input array instead:
$input = array('file' => $file, 'size' => filesize($file), base64_encode(md5_file($file, true)));