insertFile() public method
Creates new file in GridFS collection from given local filesystem file.
Additional attributes can be added file document using $metadata.
| public mixed insertFile ( $filename, $metadata = [], $options = [] ) | ||
|---|---|---|
| $filename | string | 
 Name of the file 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.