[Forminator Pro] Forminator Pro upload file extension restriction

I experience a new issue on Forminator.
As an admin login when we submit the Form from frontend with uploading SVG / PDF, it works successfully.
But in the case of non-admin users, SVG / PDF upload produce errors.
Kindly update me on this issue.

Ryan.

  • Ash

    Hello Ryan

    Forminator follows the exact file type restriction that your wordpress have. If non admin users can't upload pdf files, that means somewhere in your site has this restriction set by any other plugin or by code.

    What happens if you disable all other plugins and test the forminator?

    Or please try the following code:

    add_filter( 'upload_mimes', 'my_myme_types', 1, 1 );
    function my_myme_types( $mime_types ) {
    	$mime_types['svg'] = 'image/svg+xml';     // Adding .svg extension
    	$mime_types['pdf'] = 'application/pdf'; // Adding .pdf extension
    
    	return $mime_types;
    }

    You can use this code in your child theme's functions.php if the theme is not changed. Otherwise mu-plugin is the best option. To create a mu-plugin, go to wp-content/mu-plugins folder. If there is no mu-plugins folder then, create one. Now, inside the mu-plugins folder create file with name anything.php (make sure file extension is .php). Now start with a <?php tag and then put the above code.

    Hope it helps! Please feel free to ask more questions if you have any.

    Have a nice day!

    Cheers,
    Ash

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.