Your software
My Mautic version is: 4.0.1
My PHP version is: 7.4.x
My Database type and version is: mariadb
Your problem
We have a form which is embedded on another webiste. (using the js method, we have tested with iframe and custom script, all have same result)
CORS settings are all set correctly.
When a user submits the form and chooses the form field to upload a file (pdf, set in field settings) The form does not submit and throws an error 500
These errors are showing in the log: [2021-10-12 09:54:30] mautic.CRITICAL: Uncaught PHP Exception Symfony\Component\Debug\Exception\FatalThrowableError: "Attempted to call function "exif_imagetype" from namespace "Mautic\FormBundle\Helper"." at /home/xxx/public_html/app/bundles/FormBundle/Helper/FormUploader.php line 154 {"exception":"[object] (Symfony\\Component\\Debug\\Exception\\FatalThrowableError(code: 0): Attempted to call function \"exif_imagetype\" from namespace \"Mautic\\FormBundle\\Helper\". at /home/xxx/public_html/app/bundles/FormBundle/Helper/FormUploader.php:154)"} []
Steps I have tried to fix the problem:
Not sure where to start.
@EJL Thanks for the reply.
We tested with an image (PNG) and this did not work.
Screenshot
But our primary objective is to get a PDF uploaded, so not having this working is a concern.
I am not sure why we would have a check for an image if we are uploading a PDF.
Hi @joeyk
as a matter of interest, could you try to upload a PDF and see if you get the same issue or if this works.
Image works on our side, but not the PDF…
M
@johan_jacobs this is the thread I mentioned in my email. @raramuridesign I tested adding the upload field on one of my forms and it works perfectly. I place my money on @joeyk’s comment above; so I have asked for the two WP sites to be removed from the web server.
We get some issue with server error, see console. But this still does not make any sense as there is a cross origin issue. We have tested this on a different server which does not have cpanel but vanilla setup. So we are trying to isolate the issue here.
If you could take a look that would be awesome
thanks
M.
@joeyk@EJL Here is the error from the last test on that link
[2021-11-09 15:47:52] mautic.CRITICAL: Uncaught PHP Exception Symfony\Component\Debug\Exception\FatalThrowableError: "Attempted to call function "exif_imagetype" from namespace "Mautic\FormBundle\Helper"." at /home/xxxx/public_html/app/bundles/FormBundle/Helper/FormUploader.php line 154 {"exception":"[object] (Symfony\\Component\\Debug\\Exception\\FatalThrowableError(code: 0): Attempted to call function \"exif_imagetype\" from namespace \"Mautic\\FormBundle\\Helper\". at /home/xxxx/public_html/app/bundles/FormBundle/Helper/FormUploader.php:154)"} []
Here is an update after many hours of checking into why this happend!
Firstly, this had nothing to do with CORS. Although a different issue entirely.
Secondly, the server is running WHM/CPANEL environment.
Managed by the Hosting company, the default - chosen install by the host is to omit the very important module called - exif.
exif is required to understand the file types when uploaded by mautic.
Once this was installed and activated - the remote form embed worked without any issues.
There is an open issue on github to address the minimum requirements for Mautic, as a pre-install check. I hope this is also included soon, so these type of issues are addressed at installation, rather than when the mautic app is in full production mode.