protected function createDataObject($fileID)
    {
        $recordClass = $this->component->getRecordClassName($this->gridField);
        $record = $recordClass::create();
        $record->write();

        $record->extend('onBulkUpload', $this->gridField);

        $fileRelationName = $this->component->getFileRelationName($this->gridField);
        $record->{"{$fileRelationName}ID"} = $fileID;
        $record->write(); //HasManyList call write on record but not ManyManyList, so we call it here again
        
        $this->gridField->list->add($record);

        if ($this->component->getAutoPublishDataObject() && $record->hasExtension('Versioned'))
        {
            $record->publishRecursive();
        }

        return $record;
    }