Title: Image Extension Error
Last modified: March 31, 2023

---

# Image Extension Error

 *  Resolved [MIGHTYminnow](https://wordpress.org/support/users/mightyminnow/)
 * (@mightyminnow)
 * [3 years, 2 months ago](https://wordpress.org/support/topic/image-extension-error/)
 * We have a form creating a post where the user can upload an image which becomes
   a featured image for the post.
 * This works fine if the image has a .jpg (lowercase) extension, but now uppercase.
   JPG.
 * The form throws an error saying the file time is not accepted, no post is created,
   but confusingly the image gets uploaded all the same.
 * How can we make the form ignore the case of the extension?
 * For developers and savvy users it may not be a problem, but for less savvy users
   it would be a block.
 * Please advise.

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

 *  Plugin Support [Patrick – WPMU DEV Support](https://wordpress.org/support/users/wpmudevsupport12/)
 * (@wpmudevsupport12)
 * [3 years, 2 months ago](https://wordpress.org/support/topic/image-extension-error/#post-16617200)
 * Hi [@mightyminnow](https://wordpress.org/support/users/mightyminnow/)
 * I hope you are doing well.
 * I was able to replicate this, I see the plugin will validate those format:
 * `( 'jpg', 'jpeg', 'jpe', 'gif', 'png', 'bmp' )`
 * I tried to override this list but unfortunately didn’t work, we pinged our developers
   to verify if any workaround is possible here.
 * We will keep you posted
 * Best Regards
    Patrick Freitas
 *  Plugin Support [Amin – WPMU DEV Support](https://wordpress.org/support/users/wpmudev-support2/)
 * (@wpmudev-support2)
 * [3 years, 2 months ago](https://wordpress.org/support/topic/image-extension-error/#post-16637335)
 * Hello [@mightyminnow](https://wordpress.org/support/users/mightyminnow/) ,
 * Please try this code snippet:
 *     ```
       <?php
       function wpmudev_modify_mime_exts_file( $filename, $filename_raw ) {
           $info 			= pathinfo($filename);
           $ext  			= empty($info['extension']) ? '' : $info['extension'];
           $name 			= basename($filename, $ext);
       	$modified_exts 	= array('JPG', 'PNG', 'JPEG');
   
       	if ( !empty( $ext ) && in_array( $ext, $modified_exts ) ) {
       		$filename = str_replace( $ext, strtolower($ext),  $filename );
       	}
   
           return $filename;
       }
   
       add_action( 'forminator_form_before_save_entry', 'wpmudev_uploaded_filename_mime_check', 10, 1 );
       function wpmudev_uploaded_filename_mime_check( $form_id ) {
       	if( $form_id == 4356 ) {
       		add_filter('sanitize_file_name', 'wpmudev_modify_mime_exts_file', 10, 2);
       	}
       }
       ```
   
 * 4356 should be changed to your form’s ID.
 * This can be used as MU-plugin: [https://premium.wpmudev.org/docs/getting-started/download-wpmu-dev-plugins-themes/#installing-mu-plugins](https://premium.wpmudev.org/docs/getting-started/download-wpmu-dev-plugins-themes/#installing-mu-plugins)
 * kind regards,
    Kasia
 *  Plugin Support [Amin – WPMU DEV Support](https://wordpress.org/support/users/wpmudev-support2/)
 * (@wpmudev-support2)
 * [3 years, 2 months ago](https://wordpress.org/support/topic/image-extension-error/#post-16648580)
 * Hello [@mightyminnow](https://wordpress.org/support/users/mightyminnow/) ,
 * We haven’t heard from you for 4 days now, so it looks like you no longer need
   our assistance.
 * Feel free to re-open this ticket if required.
 * Kind regards
    Kasia

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

The topic ‘Image Extension Error’ is closed to new replies.

 * ![](https://ps.w.org/forminator/assets/icon-256x256.gif?rev=3443182)
 * [Forminator Forms – Contact Form, Payment Form & Custom Form Builder](https://wordpress.org/plugins/forminator/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/forminator/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/forminator/)
 * [Active Topics](https://wordpress.org/support/plugin/forminator/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/forminator/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/forminator/reviews/)

 * 3 replies
 * 3 participants
 * Last reply from: [Amin – WPMU DEV Support](https://wordpress.org/support/users/wpmudev-support2/)
 * Last activity: [3 years, 2 months ago](https://wordpress.org/support/topic/image-extension-error/#post-16648580)
 * Status: resolved