I have created a form with Ui component. It contains a file field. When I upload a file it shows an error in the console

Here is my code Ui component form
<field name="ffl">
<argument name="data" xsi:type="array">
<item name="config" xsi:type="array">
<item name="dataType" xsi:type="string">string</item>
<item name="source" xsi:type="string">ffl</item>
<item name="label" xsi:type="string" translate="true">Licence Pdf</item>
<item name="visible" xsi:type="boolean">true</item>
<item name="formElement" xsi:type="string">fileUploader</item>
<item name="required" xsi:type="boolean">true</item>
<item name="uploaderConfig" xsi:type="array">
<item name="url" xsi:type="url" path="ffl/ffl/fflupload"/>
</item>
</item>
</argument>
</field>
Fileupload controller
namespace NameSpace\Ffl\Controller\Adminhtml\Ffl;
use Magento\MediaStorage\Model\File\UploaderFactory;
use Magento\Framework\Controller\ResultFactory;
class Fflupload extends \NameSpace\Ffl\Controller\Adminhtml\Ffl
{
private $uploaderFactory;
private $mediaDirectory;
public function __construct(
\Magento\Backend\App\Action\Context $context,
\Magento\Framework\Registry $registry,
\Magento\Framework\Filesystem $filesystem,
UploaderFactory $uploaderFactory
) {
$this->mediaDirectory = $filesystem->getDirectoryWrite(\Magento\Framework\App\Filesystem\DirectoryList::MEDIA);
$this->uploaderFactory = $uploaderFactory;
parent::__construct($context, $registry);
}
/**
* Save action
*
* @return \Magento\Framework\Controller\ResultInterface
*/
public function execute()
{
try {
$data = $this->getRequest()->getPostValue();
$uploader = $this->uploaderFactory->create(['fileId' => 'ffl']);
$uploader->setAllowRenameFiles(true);
$uploader->setAllowedExtensions(['doc','pdf']);
$path = $this->mediaDirectory->getAbsolutePath('fflfiles/'); ;
$result = $uploader->save($path);
$result['cookie'] = [
'name' => $this->_getSession()->getName(),
'value' => $this->_getSession()->getSessionId(),
'lifetime' => $this->_getSession()->getCookieLifetime(),
'path' => $this->_getSession()->getCookiePath(),
'domain' => $this->_getSession()->getCookieDomain(),
];
} catch (\Exception $e) {
$result = ['error' => $e->getMessage(), 'errorcode' => $e->getCode()];
}
return $this->resultFactory->create(ResultFactory::TYPE_JSON)->setData($result);
}
}
Please help me.