Need to download uploaded binary file (2 posts)

  1. sabhandari
    Posted 4 years ago #


    I have uploaded a binary .war file which is nothing but a .zip file with Java web application extension. When I hit the URL for this file, I see junk characters in browsers.

    URL: http://tinyurl.com/8xwfmbm

    Need a way by which I can make the users download this file.

    By the way, I uploaded using FTP and the Add new media feature of WordPress gave me an error about File upload not supported due to security reasons.

    Pls. advise.

  2. Krishna
    Posted 4 years ago #

    By feature, WP blocks certain types of files for security reasons. You can try adding this to your theme's functions.php file

    function custom_upload_mimes($mime_types)
        $mime_types['war'] = 'application/octet-stream';
        return $mime_types;
    add_filter('upload_mimes', 'custom_upload_mimes');

Topic Closed

This topic has been closed to new replies.

About this Topic