The following code is part of a PHP web-service I\'ve written. It takes some uploaded Base64 data, decodes it, and appends it to a file. This all works fine.
The p
According to the PHP manual:
The results of this function are cached. See clearstatcache() for more details.
http://us2.php.net/manual/en/function.filesize.php
Basically, you have to clear the stat cache after the file operation:
$fileOut = fopen($filepath.$filename, "ab")
fwrite($fileOut, base64_decode($data));
fflush($fileOut);
fclose($fileOut);
clearstatcache();
$newSize = filesize($filepath.$filename);