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://www.javaquizmaker.com/QuizGenerator.war

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.

1 Answer 1


If your webserver is Apache, you'll need to tell apache what kind of mime type your file is, so Apache knows how to handle it. You should be able to use the "application/octet-stream" mime type in your .htaccess, in order for Apache to force a download. Learn more here: http://www.htaccess-guide.com/adding-mime-types/ (see the 3rd paragraph, starting with "A Handy Trick").

Regarding the media library -- by default, wordpress blocks most types of files from being uploaded. To allow more file types, you'll need to filter the allowed types. Add this to your theme's functions.php:

function custom_upload_mimes($mime_types) 
    $mime_types['war'] = 'application/octet-stream';
    return $mime_types;
add_filter('upload_mimes', 'custom_upload_mimes');
  • You are a life saver
    – Sandeep
    Jun 20, 2012 at 4:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.