|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #65173 file function with mongogridfs resource
Submitted: 2013-07-01 14:22 UTC Modified: 2013-07-14 19:44 UTC
Avg. Score:5.0 ± 0.0
Reproduced:2 of 2 (100.0%)
Same Version:1 (50.0%)
Same OS:1 (50.0%)
From: erwan dot oger35 at gmail dot com Assigned:
Status: Not a bug Package: mongo (PECL)
PHP Version: Irrelevant OS:
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Bug Type:
From: erwan dot oger35 at gmail dot com
New email:
PHP Version: OS:


 [2013-07-01 14:22 UTC] erwan dot oger35 at gmail dot com
From manual page:

Expected result:
public stream MongoGridFSFile::getResource ( void )
This method returns a stream resource that can be used with all file functions in 

so I expect to have new chunks in my fs.chunk collection when I use fwrite on a 
resource which was created by this function

Actual result:
Only the read file function run on a gridfs resource.

fwrite, fflush, fputs don't work ...


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2013-07-14 19:44 UTC]
-Status: Open +Status: Not a bug
 [2013-07-14 19:44 UTC]
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at and the instructions on how to report
a bug at

The stream resource can only be used for writing. Files stored in GridFS are considered immutable, and we've since then updated the documentation to reflect this as well.
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Mon Aug 19 14:01:26 2019 UTC