WordPress.org

Ready to get started?Download WordPress

Forums

Gravity Forms Advanced File Uploader
[resolved] File upload error (11 posts)

  1. karll10
    Member
    Posted 5 months ago #

    Hi,

    I am having a problem uploading .wav files, it gives me a file error message, as far as i am aware i have everything set up properly, any help would be much appreciated as i have just launched my site so if i could get this to work it would be great.

    Here's the URL -> http://bmgsound.com/mastering/

    Thanks

    https://wordpress.org/plugins/gravity-forms-advanced-file-uploader/

  2. Noiseman
    Member
    Posted 5 months ago #

    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

  3. ben.moody
    Member
    Plugin Author

    Posted 5 months ago #

    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

  4. Noiseman
    Member
    Posted 4 months ago #

    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;
    }

    ?>

  5. ben.moody
    Member
    Plugin Author

    Posted 4 months ago #

    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?

  6. Noiseman
    Member
    Posted 4 months ago #

    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.

  7. ben.moody
    Member
    Plugin Author

    Posted 4 months ago #

    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

  8. Noiseman
    Member
    Posted 4 months ago #

    Hi Ben,

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

    Any other thoughts?

    Thanks
    Tim

  9. Noiseman
    Member
    Posted 4 months ago #

    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

  10. ben.moody
    Member
    Plugin Author

    Posted 4 months ago #

    Hi Tim

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

    Thanks

    Ben

  11. Noiseman
    Member
    Posted 4 months ago #

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

Reply

You must log in to post.

About this Plugin

About this Topic

Tags

No tags yet.