private function insertFile()
{
$fileDocument = ['_id' => $this->documentId, 'uploadDate' => new UTCDateTime(round(microtime(true) * 1000))];
if ($this->filename === null) {
$fileDocument['filename'] = $this->documentId . '.dat';
} else {
$fileDocument['filename'] = $this->filename;
}
$fileDocument = array_merge($fileDocument, $this->document, ['chunkSize' => $this->chunkSize, 'length' => $this->length, 'md5' => hash_final($this->hashContext)]);
$this->collection->insert($fileDocument);
return $fileDocument;
}