note 103965 deleted from mongogridfsfile.getbytes by danbrown
| From: | danbrown@php.net | Date: | Sat, 14 May 2011 01:40:44 +0000 |
| Subject: | note 103965 deleted from mongogridfsfile.getbytes by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-179710@lists.php.net to get a copy of this message | ||
Note Submitter: artem dot sakhnov at gmail dot com
----
when u saving 0 sized file it ok, mongo saving its. but record in db have no lenght attribute.
and after, when you'll try to read file just saved, you will got a MongoGridFSException.
So to avoid this, need to check for length before
if (gridfs.getSize()>0) {
// do your needs
}