protected function preserveSourceDocument($tmpfile, $chosenFolderID = null)
    {
        $upload = Upload::create();

        $file = File::create();
        $upload->loadIntoFile($tmpfile, $file, $chosenFolderID);

        $page = $this->form->getRecord();
        $page->ImportedFromFileID = $file->ID;
        $page->write();

        return $file;
    }