public function scheduleForUpload($value, $entity, $field)
    {
        if (is_string($value)) {
            // try to locate the file on disk
            $value = new FixtureFile($this->fileManager->getFilePath($entity, $field, $value));
        }

        if ($value instanceof File) {
            $replaceFile = isset($value->metaData['keep_previous_filename']) and $value->metaData['keep_previous_filename'];
            $path = $this->fileManager->prepare($value, $entity, $field, !$replaceFile);
            $fileName = basename($path);
            PropertyHelper::setValue($entity, $field, $fileName);
            $this->unitOfWork[spl_object_hash($entity)][$field]['save'] = function ($fm) use ($value, $path) {
                $fm->save($value, $path);
            };
            return $fileName;
        } else {
            throw new \InvalidArgumentException("Invalid argument to scheduleForUpload(): " . gettype($value));
        }
    }