File content is lost after flush() #290

myurasov opened this Issue Apr 9, 2012 · 4 comments


None yet
4 participants

myurasov commented Apr 9, 2012

$dm = DocumentManager::getInstance();

$fileName = tempnam(null, null);
file_put_contents($fileName, "abc");

$file = new \Documents\File();


echo ($file->getFile()->getBytes()); // "abc"


echo ($file->getFile()->getBytes()); // "abc", *should be "123"*


jmikola commented Apr 9, 2012

Could you turn this code example into a failing test case? File creation is probably best done with tempnam() and sys_get_temp_dir() for this purpose. Thanks.

myurasov commented Apr 9, 2012

You mean like this?


jmikola commented Apr 10, 2012

A pull request with a failing test case is preferable.

@malarzm malarzm added the needs test label Jan 21, 2016

@alcaeus alcaeus closed this Dec 22, 2017


alcaeus commented Dec 22, 2017

GridFS is getting a rewrite for 2.0, so I'm closing this (and we still need a test case).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment