I am tryng to upload pdf files from the frontend with the user profile form (femanager), it only allows me to use the "Image" field, but for this case more pdf file fields are needed.
I have the following custom field for it
<f:form.upload
id="femanager_field_pdf"
property="pdf.0"
class="custom-file-input" />
In the extended User class
/**
* @var ObjectStorage<FileReference>
*/
protected $pdf;
/**
* Gets the pdf value
*
* @return ObjectStorage<FileReference>
*/
public function getPdf()
{
return $this->pdf;
}
/**
* Sets the pdf value
*
* @param ObjectStorage<FileReference> $pdf
*/
public function setpdf(ObjectStorage $pdf)
{
$this->pdf = $pdf;
}
I expected that when saving the user profile form the file would be saved in the "pdf" field but it generates an error
Exception while property mapping at property path "pdf.0": Property "name" was not found in target object of type "TYPO3\CMS\Extbase\Domain\Model\FileReference".
For
fe_manageryou need to add a new DataProcessor.See TypoScript setup:
Then add a new DataProcessor class. See
In2code\Femanager\DataProcessorfor example.Background: The image or PDF needs to be uploaded to the server first. Then a sys_file_reference needs to be created. After that the request arguments are change to the new file UID.