• Resolved frenchomatic

    (@frenchomatic)


    Many thanks for any help provided in advance.

    I have uploaded your plugin. In my functions.php I have this code

    function allow_special_uploads ( $existing_mimes=array() ) {

    $existing_mimes[‘slave’] = ‘application/octet-stream’;
    $existing_mimes[‘bin’] = ‘application/octet-stream’;
    $existing_mimes[‘kess’] = ‘application/zip’;

    return $existing_mimes;
    }
    add_filter(‘upload_mimes’, ‘allow_special_uploads’);

    This allows me to upload .bin files with the defined MIME type. However, I sometimes get .bin files with a different MIME type. Namely the MIME type x-dosexec. I am unable to upload .bin files with this x-dosexec type. I can’t seem to permit .bin files to have two different MIME types.

    Your plugin says Error: The file type could not be determined.

    VALIDATION:
    Naive Name: test.bin
    Naive Extension: bin
    Naive Type: application/octet-stream
    Magic Type: application/x-dosexec
    Best Type:

    FINAL:
    Name: test.bin
    Extension:
    Type:
    Code: 64

    SYSTEM:
    Kernel: Linux nl1-ts109.a2hosting.com 4.18.0-513.11.1.lve.el8.x86_64 #1 SMP Thu Jan 18 16:21:02 UTC 2024 x86_64
    PHP: 8.1.28
    Modules: Core; PDO; PDO_ODBC; Phar; Reflection; SPL; SimpleXML; bcmath; bz2; calendar; clos_ssa; ctype; curl; date; dba; dom; enchant; exif; fileinfo; filter; ftp; gd; gettext; hash; i360; iconv; imagick; imap; intl; json; ldap; libxml; litespeed; mbstring; mysqli; mysqlnd; odbc; openssl; pcntl; pcre; pdo_mysql; pdo_pgsql; pdo_sqlite; pgsql; posix; pspell; readline; session; shmop; soap; sockets; sqlite3; standard; sysvmsg; sysvsem; sysvshm; tidy; tokenizer; xml; xmlreader; xmlwriter; xsl; zip; zlib
    WordPress: 6.5.4
    Plugins: BeRocket_LGV_domain [1.1.4]; admin-menu-editor [1.12.2]; adminimize [1.11.11]; blob-mimes [1.3.19]; classic-editor-and-classic-widgets [1.3.8]; contact-form-7 [5.9.5]; creame-whatsapp-me [5.1.6]; decorator-woocommerce-email-customizer [1.2.9]; ewww-image-optimizer [7.7.0]; hide-login-page [1.1.9]; js_composer [7.7.1]; loco-translate [2.6.10]; ninjafirewall [4.5.11]; print-invoices-packing-slip-labels-for-woocommerce [4.5.3]; upb_parallax [1.5.15]; user-role-editor [4.64.2]; user-switching [1.7.3]; woo-checkout-field-editor-pro [2.0.2]; woo-stripe-payment [3.3.71]; woocommerce [8.9.3]; woocommerce-file-approval [9.9]; woocommerce-files-upload [76.7]; wordpress-seo [22.8]; worker [4.9.20]; wp-mail-smtp [4.0.1]
    Theme: fortuna [3.20]

    • This topic was modified 5 months, 1 week ago by frenchomatic.
    • This topic was modified 5 months, 1 week ago by frenchomatic.
Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter frenchomatic

    (@frenchomatic)

    It seems I can get it to work if I edit the alias file to include application/x-dosexec

    ‘bin’=>array(
    ‘application/gltf-buffer’,
    ‘application/octet-stream’,
    ‘application/x-dosexec’,

    an then in functions.php this

    function allow_special_uploads ( $existing_mimes=array() ) {

    $existing_mimes[‘slave’] = ‘application/octet-stream’;
    $existing_mimes[‘bin’] = ‘application/octet-stream’;
    $existing_mimes[‘kess’] = ‘application/zip’;

    return $existing_mimes;
    }
    add_filter(‘upload_mimes’, ‘allow_special_uploads’);

    Plugin Author Blobfolio

    (@blobfolio)

    Thanks for reporting, @frenchomatic !

    application/x-dosexec has been added to the type alias list for bin files in the latest version of the plugin (1.3.20).

    Please do me a favor and retest that file upload once you’ve updated Lord of the Files just to be sure, but those files shouldn’t give you any more trouble. ??

    Thread Starter frenchomatic

    (@frenchomatic)

    All is good. Plugin update works perfectly. Hopefully this post will help others if they get an unusual MIME type. they can report it and it can be added. This part of wordpress is actually a mess. Your plugin cleans it up. And thanks.

    Plugin Author Blobfolio

    (@blobfolio)

    Thanks for confirming, @frenchomatic !

    The multi-MIME problem is the main reason this plugin exists. I spent a couple years trying to address this in WP core itself, but there was zero upstream interest.

    C’est la vie…

Viewing 4 replies - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.