protected function fetchUploadedFile($form)
    {
        $file = '';

        // for backward compatibility
        if ($form instanceof \tao_helpers_form_Form) {
            $fileInfo = $form->getValue('source');

            /** @var string $file */
            $file = $form->getValue('importFile') ?: $fileInfo['uploaded_file']; // key "importFile" used in CSV import
        } else if (isset($form['uploaded_file'])) {
            /** @var File $file */
            $file = $this->getUploadService()->getUploadDir()->getFile($form['uploaded_file']);
        }

        if (!$file) {
            throw new \common_exception_Error('No source file for import');
        }

        return $file;
    }
protected function fetchUploadedFile($form)
    {
        $file = '';

        // for backward compatibility
        if ($form instanceof \tao_helpers_form_Form) {
            $fileInfo = $form->getValue('source');

            /** @var string $file */
            $file = $form->getValue('importFile') ?: $fileInfo['uploaded_file']; // key "importFile" used in CSV import
        } else if (isset($form['uploaded_file'])) {
            /** @var File $file */
            $file = $this->getUploadService()->getUploadDir()->getFile($form['uploaded_file']);
        }

        if (!$file) {
            throw new \common_exception_Error('No source file for import');
        }

        return $file;
    }
protected function fetchUploadedFile ( $ form ) { $ file = '' ; // for backward compatibility if ( $ form instanceof \ tao_helpers_form_Form ) { $ fileInfo = $ form -> getValue ( 'source' ) ; /** @var string $file */ $ file = $ form -> getValue ( 'importFile' ) ? : $ fileInfo [ 'uploaded_file' ] ; // key "importFile" used in CSV import } else if ( isset ( $ form [ 'uploaded_file' ] ) ) { /** @var File $file */ $ file = $ this -> getUploadService ( ) -> getUploadDir ( ) -> getFile ( $ form [ 'uploaded_file' ] ) ; } if ( ! $ file ) { throw new \ common_exception_Error ( 'No source file for import' ) ; } return $ file ; }
Helps to get the uploaded file data during upload or during processing of the import task.

@param array|\tao_helpers_form_Form $form
@return File|string
@throws \common_exception_Error
Helps to get the uploaded file data during upload or during processing of the import task .