How To Allow Upload Of APK Files In WordPress

How To Allow Upload Of APK Files In WordPress
4 (80%) 4 votes

Trying to upload an .apk file to your wordpress post?
Getting: Sorry, patient this file type is not permitted for security reasons?

Allow Upload .apk files

Here is a TWO STEP solution, … you can do it in 1 minute.

  1. Open the functions.php file of the theme you are using, located in:
    wp-content/themes/xxx-your-selected-theme-xxx/functions.php
  2. and add this lines of code:
add_filter('upload_mimes', 'acp_custom_mimes');

function acp_custom_mimes ( $existing_mimes=array() ) {
// ' with mime type '<code>application/vnd.android.package-archive</code>'
$existing_mimes['apk'] = '<code>application/vnd.android.package-archive</code>';
return $existing_mimes;
}

That’s all, it’s that easy.

dCwoeT

EXTRA: List Of Other Mime Types You May Need To Upload

you just have to add additional lines of code like:

$existing_mimes[‘au’] = ‘audio/basic';
$existing_mimes[‘zip’] = ‘application/zip, application/x-compressed-zip';

Extensions Media type
.au audio/basic
.avi video/msvideo, video/avi, video/x-msvideo
.bmp image/bmp
.bz2 application/x-bzip2
.css text/css
.dtd application/xml-dtd
.doc application/msword
.docx application/vnd.openxmlformats-officedocument.wordprocessingml.document
.dotx application/vnd.openxmlformats-officedocument.wordprocessingml.template
.es application/ecmascript
.exe application/octet-stream
.gif image/gif
.gz application/x-gzip
.hqx application/mac-binhex40
.html text/html
.jar application/java-archive
.jpg image/jpeg
.js application/x-javascript
.midi audio/x-midi
.mp3 audio/mpeg
.mpeg video/mpeg
.ogg audio/vorbis, application/ogg
.pdf application/pdf
.pl application/x-perl
.png image/png
.potx application/vnd.openxmlformats-officedocument.presentationml.template
.ppsx application/vnd.openxmlformats-officedocument.presentationml.slideshow
.ppt application/vnd.ms-powerpointtd>
.pptx application/vnd.openxmlformats-officedocument.presentationml.presentation
.ps application/postscript
.qt video/quicktime
.ra audio/x-pn-realaudio, audio/vnd.rn-realaudio
.ram audio/x-pn-realaudio, audio/vnd.rn-realaudio
.rdf application/rdf, application/rdf+xml
.rtf application/rtf
.sgml text/sgml
.sit application/x-stuffit
.sldx application/vnd.openxmlformats-officedocument.presentationml.slide
.svg image/svg+xml
.swf application/x-shockwave-flash
.tar.gz application/x-tar
.tgz application/x-tar
.tiff image/tiff
.tsv text/tab-separated-values
.txt text/plain
.wav audio/wav, audio/x-wav
.xlam application/vnd.ms-excel.addin.macroEnabled.12
.xls application/vnd.ms-excel
.xlsb application/vnd.ms-excel.sheet.binary.macroEnabled.12
.xlsx application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
.xltx application/vnd.openxmlformats-officedocument.spreadsheetml.template
.xml application/xml
.zip application/zip, application/x-compressed-zip

 

 

If it worked for you, please leave a comment.

Deja un comentario

Tu dirección de correo electrónico no será publicada. Los campos necesarios están marcados *

Puedes usar las siguientes etiquetas y atributos HTML: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>