MongoGridFSFile
class MongoGridFSFile (View source)
Properties
array|null | $file | ||
protected MongoGridFS|null | $gridfs |
Methods
Returns this file's filename
Returns this file's size
Writes this file to the filesystem
This will load the file into memory. If the file is bigger than your memory, this will cause problems!
This method returns a stream resource that can be used to read the stored file with all file functions in PHP.
Details
__construct(MongoGridFS $gridfs, array $file)
No description
string
getFilename()
Returns this file's filename
int
getSize()
Returns this file's size
int
write(string $filename = null)
Writes this file to the filesystem
string
getBytes()
This will load the file into memory. If the file is bigger than your memory, this will cause problems!
resource
getResource()
This method returns a stream resource that can be used to read the stored file with all file functions in PHP.
The contents of the file are pulled out of MongoDB on the fly, so that the whole file does not have to be loaded into memory first. At most two GridFSFile chunks will be loaded in memory.