mongodb\file\Download toString()

toString() public method Returns a string of the bytes in the associated file. public string toString ( )return string File content.

mongodb\file\Download toStream()

toStream() public method Saves file into the given stream. public integer toStream ( $stream )$stream resource Stream, which file should be saved to. return integer Number of written bytes.

mongodb\file\Download toResource()

toResource() public method Returns an opened stream resource, which can be used to read file. Note: each invocation of this method will create new file resource. public resource toResource ( )return resource Stream resource.

mongodb\file\Download toFile()

toFile() public method Saves download to the physical file. public integer toFile ( $filename )$filename string Name of the physical file. return integer Number of written bytes.

mongodb\file\Download setDocument()

setDocument() public method Sets data of the document to be downloaded. Document can be specified by its ID, in this case its data will be fetched automatically via extra query. public void setDocument ( $document )$document array|\MongoDB\BSON\ObjectID Document raw data or document ID.

mongodb\file\Download getSize()

getSize() public method Returns the size of the associated file. public integer getSize ( )return integer File size.

mongodb\file\Download substr()

substr() public method Return part of a file. public string|false substr ( $start, $length )$start integer Reading start position. If non-negative, the returned string will start at the start'th position in file, counting from zero. If negative, the returned string will start at the start'th character from the end of file. $length integer Number of bytes to read. If given and is positive, the string returned will contain at most length characters beginning from start (depending on the

mongodb\file\Download getDocument()

getDocument() public method public array getDocument ( )return array Document to be downloaded. throws yii\base\InvalidConfigException on invalid document configuration.

mongodb\file\Download getResource()

getResource() public method Returns persistent stream resource, which can be used to read file. public resource getResource ( )return resource File stream resource.

mongodb\file\Download getChunkIterator()

getChunkIterator() public method Returns iterator for the file chunks cursor. public Iterator getChunkIterator ( $refresh = false )$refresh boolean Whether to recreate iterator, if it is already exist. return Iterator Chuck cursor iterator.