mongodb\file\Collection insertUploads()

insertUploads() public method

Creates new file in GridFS collection from uploaded file.

Additional attributes can be added file document using $metadata.

public mixed insertUploads ( $name, $metadata = [], $options = [] )
$name string

Name of the uploaded file to store. This should correspond to the file field's name attribute in the HTML form.

$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.

doc_Yii
2016-10-30 17:08:22
Comments
Leave a Comment

Please login to continue.