insertFileContent() public method
Creates new file in GridFS collection with specified content.
Additional attributes can be added file document using $metadata.
public mixed insertFileContent ( $bytes, $metadata = [], $options = [] ) | ||
---|---|---|
$bytes | string |
String of bytes to store. |
$metadata | array |
Other metadata fields to include in the file document. |
$options | array |
List of options in format: optionName => optionValue |
return | mixed |
The "_id" of the saved file document. This will be a generated \MongoId unless an "_id" was explicitly specified in the metadata. |
throws | yii\mongodb\Exception |
on failure. |
Please login to continue.