yii\mongodb\file\Upload::cancel PHP Method

cancel() public method

Cancels the upload.
public cancel ( )
    public function cancel()
    {
        $this->buffer = null;
        $this->collection->getChunkCollection()->remove(['files_id' => $this->documentId], ['limit' => 0]);
        $this->collection->remove(['_id' => $this->documentId], ['limit' => 1]);
        $this->isComplete = true;
    }