Support » Plugin: Gravity Forms Advanced File Uploader » File upload error

Viewing 10 replies - 1 through 10 (of 10 total)
  • I’m having the same problem. I get the error message File Type Error: audio/x-wav.

    Karl…I see you are getting the same error.

    Anybody got a solution?

    Thanks

    Plugin Author ben.moody

    (@benmoody)

    Hi

    There are two issues here:

    1. The error is due to the malformed file name. The name has both a . (dot) and a – (dash) in it this causes an error with plupload.

    2. The wav file you passed has a mime type of audio/x-wav. WordPress’s list of allowed safe file types only registers audio/wav.

    You will have to add your custom mime type using one of my plugin’s filters. Add this to your functions.php file in your theme:

    add_filter( ‘prso_adv_uploader_reject_mimes’, ‘prso_uploader_add_mime’ );
    function prso_uploader_add_mime( $allowed_mime_types ) {

    $allowed_mime_types[‘wav’] = ‘audio/x-wav’;

    return $allowed_mime_types;
    }

    This should sort you out.

    Thanks

    Ben

    Hi Ben,
    Thanks for taking the time to look at this for me. Unfortunately it still doesn’t seem to work. I’m not a programmer so it took me a while to work out how to do what you recommended but I think i got there in the end. Would you mind having a quick look at the code in my functions.php file to check I’ve inserted it correctly? Also slightly concerned that the script says not to edit it any way!
    Thanks
    Tim

    <?php

    // Exit if accessed directly
    if( !defined( ‘ABSPATH’ ) ) {
    exit;
    }

    /**
    *
    * WARNING: Please do not edit this file in any way
    *
    * load the theme function files
    */

    $template_directory = get_template_directory();

    require( $template_directory . ‘/core/includes/functions.php’ );
    require( $template_directory . ‘/core/includes/functions-update.php’ );
    require( $template_directory . ‘/core/includes/functions-sidebar.php’ );
    require( $template_directory . ‘/core/includes/functions-install.php’ );
    require( $template_directory . ‘/core/includes/theme-options/theme-options.php’ );
    require( $template_directory . ‘/core/includes/post-custom-meta.php’ );
    require( $template_directory . ‘/core/includes/tha-theme-hooks.php’ );
    require( $template_directory . ‘/core/includes/hooks.php’ );
    require( $template_directory . ‘/core/includes/version.php’ );
    require( $template_directory . ‘/core/includes/upsell/theme-upsell.php’ );

    add_filter( ‘prso_adv_uploader_reject_mimes’, ‘prso_uploader_add_mime’ );
    function prso_uploader_add_mime( $allowed_mime_types ) {
    $allowed_mime_types[‘wav’] = ‘audio/x-wav’;
    return $allowed_mime_types;
    }

    // Return value of the supplied responsive free theme option.
    function responsive_free_get_option( $option, $default = false ) {
    global $responsive_options;

    // If the option is set then return it’s value, otherwise return false.
    if( isset( $responsive_options[$option] ) ) {
    return $responsive_options[$option];
    }

    return $default;
    }

    ?>

    Plugin Author ben.moody

    (@benmoody)

    That should work, it did for another user and i’ve tested too.

    1. Are you sure you added it to the correct theme, the currently active theme
    2. What is the error message you are getting after adding the code?

    Hi….yes I think so. My current theme is Responsive and the functions.php file is in a sub-folder called Core. The error message I get is ‘error: Invalid file extension: Music .wav’
    Thanks again for your help.

    Plugin Author ben.moody

    (@benmoody)

    Hi i think is see the problem.

    Your filename has a space before the .wav extension. That’s an invalid filename.

    remove the space before .wav and try again

    Ben

    Hi Ben,

    I’ve removed the space and tried another file too but still the same error message.

    Any other thoughts?

    Thanks
    Tim

    A ha!!

    I removed the advanced file uploader from the form and then reinserted it and it seems to have done the trick.

    Thanks for taking the trouble to help me. It always amazes me when people will give up their time like that when there is no reward. You are a gent!

    Thanks
    Tim

    Plugin Author ben.moody

    (@benmoody)

    Hi Tim

    No problem, if the plugin helps you out please give it a rating and review.

    Thanks

    Ben

    I shall do that. It’s perfect for what I need.
    Tim

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘File upload error’ is closed to new replies.