Search code examples
wordpressmultisite

WordPress upload file


I would like to upload a file like as (.apk) but I can't. I receive this message. Sorry, this file type is not allowed for security reasons.

I show solutions as to settings on multisite, but I don't have this choice on my version. In which way I could enable the settings of multisite?

Is there any way to upload files like apk,( may a plugin)?

Thank you in advance!


Solution

  • Open your functions.php file and add the following code inside it.

    add_filter('upload_mimes', 'allow_custom_mimes');
    
    function allow_custom_mimes ( $existing_mimes = array() ) {
      // with mime type ‘application/vnd.android.package-archive
      $existing_mimes['apk'] = 'application/vnd.android.package-archive';
      return $existing_mimes;
    }
    

    Restart your server after adding code and check.