• Resolved FinnDorian

    (@finndorian)


    I have restricted the file upload and only allowed .zip files to be uploaded, still I am able to upload following file endings in addition to .zip:
    .avif .heif .heics .heifs .xls .svgz .json

    No difference in being logged in or not logged in when I am using the form.
    Tested in Firefox/Chrome.

    I tried adding this to my themes functions.php or as a mu-plugin with no effect:

        add_filter( 'forminator_upload_allowed_files', function( $file_types ) {
        // Define the file extensions to remove
        $remove_types = [ 'avif', 'heif', 'avif', 'heic' ]; // Also includes heic if desired
    
        // Filter out the disallowed types
        $file_types = array_diff( $file_types, $remove_types );
    
        return $file_types;
    } );

    I also installed Plugins like WordPress Plugins like “WP Upload Restriction – WordPress plugin” with no effect.

    Can you help me?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter FinnDorian

    (@finndorian)

    Okay I have actually tested to upload a file of that type (tested with .heif)… and got the message that I am not allowed… so I’m kind of fine with it, but still confused why it shows up as selectable in the browser together with the allowed .zip filetype…

    Plugin Support Saurabh – WPMU DEV Support

    (@wpmudev-support7)

    Hello @finndorian

    Hope you’re doing well today!

    I was able to replicate the issue you’ve noticed on a fresh form. The file formats like .avif, .heic & .heif should be greyed out for selection ideally, and hence I have tasked this as a bug to the Forminator team.

    However, please note the end validation of the field format does work fine, as you noted the avif, .heic & .heif files should trigger an error at the final submission of the form. As of now, I can’t give an estimated time yet for the fix but subscribing to our roadmap https://wpmudev.com/roadmap/ is a good way to be posted about upcoming versions. Once they are released, it is going to be described in the changelog found on https://wordpress.org/plugins/forminator/#developers as well.

    Kind Regards,
    Saurabh

    Thread Starter FinnDorian

    (@finndorian)

    Thank you!

Viewing 3 replies - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.