Page is a not externally linkable
tfk11 - 4:07 am on Nov 30, 2009 (gmt 0)
Quote from the manual on ob_flush(): This function will send the contents of the output buffer (if any). If you want to further process the buffer's contents you have to call ob_get_contents() before ob_flush() as the buffer contents are discarded after ob_flush() is called.
You're flushing the buffer before writing the file so you're writing an empty buffer.