• Resolved 007canada

    (@007canada)


    The form submits fine, however, the file upload gives me an error “An error occurred processing the form. Please try again”.
    If I go back to 1.9.2 it works fine.
    Thanks in advance,
    James

    The page I need help with: [log in to see the link]

Viewing 12 replies - 1 through 12 (of 12 total)
  • Plugin Support Laura – WPMU DEV Support

    (@wpmudev-support8)

    Hello @007canada

    I hope you’re well today!

    The 1.9.2 to 1.11.2 release it’s a huge jump and between these version there were some quite significant updates that might have affected forms’ configuration. I understand that you were using 1.9.2 (and it worked) and you then updated directly to most recent one?

    If yes, could you please try upgrading again but “gradually” this time? You would find all the releases in-between here:

    https://ww.wp.xz.cn/plugins/forminator/advanced/

    so could you try upgrading first from 1.9.2 to 1.10.1 and then up version by version manually?

    Usually that shouldn’t be any issue but in this case it’s worth checking. If it doesn’t help, please rollback to 1.9.2 again to keep the form working and then please export the form and share the export file with us here (please mark it as “code” in the post).

    We would then be able to import the form to a test environment and investigate the issue to find out why it’s not working for you and how to solve it.

    Best regards,
    Adam

    Thread Starter 007canada

    (@007canada)

    I did this, but in reverse.
    I setup the account to work, then updated as updates came out. I was not aware until the client noticed that the uploads were not working.
    Then I rolled back to 1.10.1 and it did not work. Rolled back to 1.9.2 and it worked.
    Here is a clean install I created before I put in the support ticket just to make sure there were no conflicts:
    http://fominatortest.creativesolutionscanada.com/

    Hi,
    I am having a similar issue with 1.11.2 (newly installed)
    The form submits without upload is fine. However, the file upload gives me an error “An error occurred processing the form. Please try again”.

    • This reply was modified 6 years, 4 months ago by zhjlvsb.
    Thread Starter 007canada

    (@007canada)

    Hey guys, any updates? Anything I can do to help or test?

    • This reply was modified 6 years, 3 months ago by 007canada.
    Plugin Support Imran – WPMU DEV Support

    (@wpmudev-support9)

    Hello @007canada

    I hope you are doing well!

    I’ve tested this issue on my end and can’t replicate the same. On your site, there is a 500 error showing up after submitting the form, in the developer’s console

    Please enable debug mode by placing the following to the wp-config.php file:

    
    define( 'WP_DEBUG', true );
    define( 'WP_DEBUG_LOG', true );
    define( 'WP_DEBUG_DISPLAY', false );
    

    Please make sure that you insert these lines above /* That's all, stop editing! Happy blogging. */ in the wp-config.php file.

    Re-submit the form. This way all errors will be saved in the debug.log file inside the /wp-content/ directory. Please share the content from this file with us.

    @zhjlvsb, thank you for posting in this thread, however, because this issue is posted by a different author, please create a new one. This way, the author will not be getting email notifications each time when there is a new post in the thread.

    Kind regards,
    Nastia

    Thread Starter 007canada

    (@007canada)

    I added this the debug but strangely, there are no errors reporting. I see the 500 errors in the network panel. They did not happen all the time.

    While I was in the admin and trying to see the entries, I had: Fatal error: Allowed memory size of…

    I added define( ‘WP_MEMORY_LIMIT’, ‘256M’ ); to wp-config.php

    Since this, I have not had an error on the testing website I originally listed.

    However, I go over to my clients website and follow the same steps. Here is what it says:

    [27-Feb-2020 22:10:52 UTC] PHP Fatal error: Uncaught Error: Call to undefined function mime_content_type() in /home/lymphati/public_html/wp-content/plugins/forminator/library/fields/upload.php:350
    Stack trace:
    #0 /home/lymphati/public_html/wp-content/plugins/forminator/library/modules/custom-forms/front/front-action.php(799): Forminator_Upload->handle_file_upload(Array)
    #1 /home/lymphati/public_html/wp-content/plugins/forminator/library/modules/custom-forms/front/front-action.php(426): Forminator_CForm_Front_Action->handle_form(’59’)
    #2 /home/lymphati/public_html/wp-includes/class-wp-hook.php(286): Forminator_CForm_Front_Action->save_entry(”)
    #3 /home/lymphati/public_html/wp-includes/class-wp-hook.php(310): WP_Hook->apply_filters(”, Array)
    #4 /home/lymphati/public_html/wp-includes/plugin.php(465): WP_Hook->do_action(Array)
    #5 /home/lymphati/public_html/wp-admin/admin-ajax.php(173): do_action(‘wp_ajax_formina…’)
    #6 {main}
    thrown in /home/lymphati/public_html/wp-content/plugins/forminator/library/fields/upload.php on line 350

    I tried this on another site and found the similar error message (#5):

    [27-Feb-2020 22:20:37 UTC] PHP Fatal error: Uncaught Error: Call to undefined function mime_content_type() in /home/cscdotcom/public_html/wp-content/plugins/forminator/library/fields/upload.php:350
    Stack trace:
    #0 /home/cscdotcom/public_html/wp-content/plugins/forminator/library/modules/custom-forms/front/front-action.php(799): Forminator_Upload->handle_file_upload(Array)
    #1 /home/cscdotcom/public_html/wp-content/plugins/forminator/library/modules/custom-forms/front/front-action.php(426): Forminator_CForm_Front_Action->handle_form(‘17895’)
    #2 /home/cscdotcom/public_html/wp-includes/class-wp-hook.php(288): Forminator_CForm_Front_Action->save_entry(”)
    #3 /home/cscdotcom/public_html/wp-includes/class-wp-hook.php(312): WP_Hook->apply_filters(”, Array)
    #4 /home/cscdotcom/public_html/wp-includes/plugin.php(478): WP_Hook->do_action(Array)
    #5 /home/cscdotcom/public_html/wp-admin/admin-ajax.php(190): do_action(‘wp_ajax_nopriv_…’)
    #6 {main}
    thrown in /home/cscdotcom/public_html/wp-content/plugins/forminator/library/fields/upload.php on line 350

    Let me know if there is anything else I can do help.

    James

    Plugin Support Laura – WPMU DEV Support

    (@wpmudev-support8)

    Hey @007canada

    I’m glad to hear that you’ve managed to solve the initial issue!

    As for the fatal error on the other site. Could you please check if the site’s powered by php 7 or higher and if not, update PHP on the server? Usually this can be done via cPanel or similar management panel but if not, you might need to get in touch with your host and ask them for it.

    If it already is or it’s not possible to upgrade, please check also (you might, again, need to consult your host about it) if there’s a “fileinfo” extension active for PHP – if not, it should be enabled.

    Best regards,
    Adam

    Thread Starter 007canada

    (@007canada)

    I realized it is working because I rolled it back to 1.9.2. False alarm. 🙁

    I did a clean install using the WordPress manual download (instead of installatron)

    http://formtest2.creativesolutionscanada.com/sample-page/

    PHP Version ea-php73, WordPress 5.3.2 running Twenty Twenty theme, Forminator Version 1.11.3

    I still have the errors:
    [28-Feb-2020 18:15:12 UTC] PHP Fatal error: Uncaught Error: Call to undefined function mime_content_type() in /home/cscdotcom/formtest2.creativesolutionscanada.com/wp-content/plugins/forminator/library/fields/upload.php:350
    Stack trace:
    #0 /home/cscdotcom/formtest2.creativesolutionscanada.com/wp-content/plugins/forminator/library/modules/custom-forms/front/front-action.php(799): Forminator_Upload->handle_file_upload(Array)
    #1 /home/cscdotcom/formtest2.creativesolutionscanada.com/wp-content/plugins/forminator/library/modules/custom-forms/front/front-action.php(426): Forminator_CForm_Front_Action->handle_form(‘5’)
    #2 /home/cscdotcom/formtest2.creativesolutionscanada.com/wp-includes/class-wp-hook.php(288): Forminator_CForm_Front_Action->save_entry(”)
    #3 /home/cscdotcom/formtest2.creativesolutionscanada.com/wp-includes/class-wp-hook.php(312): WP_Hook->apply_filters(”, Array)
    #4 /home/cscdotcom/formtest2.creativesolutionscanada.com/wp-includes/plugin.php(478): WP_Hook->do_action(Array)
    #5 /home/cscdotcom/formtest2.creativesolutionscanada.com/wp-admin/admi in /home/cscdotcom/formtest2.creativesolutionscanada.com/wp-content/plugins/forminator/library/fields/upload.php on line 350

    I have tried png, jpg, pdf, txt all with the same error of undefined function mime_content_type()

    Thanks in advance,

    James

    Plugin Support Imran – WPMU DEV Support

    (@wpmudev-support9)

    Hello @007canada

    I trust you are doing well!

    Judging from this error, it looks like your server doesn’t support Fileinfo PHP module. Please contact your hosting provider and ask them to enable this module.

    As a temporary workaround, please create a an empty file with a name forminator-fix-undefined-func-mime-content-type.php, inside /wp-content/mu-plugins directory and add this code inside

    <?php
    if( ! function_exists('mime_content_type') ){
    	function mime_content_type( $file ){
    	    $filetype = wp_check_filetype( $file );
    	    return $filetype['type'];
    	}
    }

    If the mu-plugins folder doesn’t exist, please feel free to create it.

    Let us know how it went!

    Kind regards,
    Nastia

    Plugin Support Imran – WPMU DEV Support

    (@wpmudev-support9)

    Hello @007canada

    I hope you are doing well!

    We haven’t heard back from you for a while now so we’ve marked this ticket as resolved. If you do have any followup questions or require further assistance feel free to reopen it and let us know here.

    Kind regards,
    Nastia

    Hi Nastia,

    Hope all is well.

    Love the Forminator Forms Plugin!

    This fix worked for me:

    ”Hello @007canada

    I trust you are doing well!

    Judging from this error, it looks like your server doesn’t support Fileinfo PHP module. Please contact your hosting provider and ask them to enable this module.

    As a temporary workaround, please create a an empty file with a name forminator-fix-undefined-func-mime-content-type.php, inside /wp-content/mu-plugins directory and add this code inside

    <?php
    if( ! function_exists(‘mime_content_type’) ){
    function mime_content_type( $file ){
    $filetype = wp_check_filetype( $file );
    return $filetype[‘type’];
    }
    }

    If the mu-plugins folder doesn’t exist, please feel free to create it.

    Let us know how it went!

    Kind regards,
    Nastia”

    Before I applied this patch, the upload function would cause an error. Now it works perfectly. Before this fix I had to run version 1.9.2 to allow for successful uploads.

    Thank you very much for sharing this solution.

    Regards,

    Steve.

    Just a short info:

    The fix also works in later version (1.14.x in my case).

    Give it a try.

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

The topic ‘file upload not working correctly’ is closed to new replies.