How to Upload dot apk file on your wordpress website:
Apk is the short form of “android packages” which contains a set of codes to perform a set of function. WordPress is a world’s largest open source software which is used to develop a web pages online.
In wordpress, you can upload any type of media files such as mp3, mp4, avi, jpg, png etc. at the same time wordpress has in built blocking to stop uploading software files such as .apk, .exe, .dll etc. for the security reasons.
But, by adding a piece of code we can easily upload any of the file to your wordpress directory. Let start how to upload .apk files on wordpress website.
Upload software files on WordPress:
Our ultimate aim is to add some piece of php coding on function.php file, we can enable the .apk file upload on your wordpress website.
Step1: Login to your wordpress website using https://tamiltrick.com/admin, Now you see wordpress dashboard.
Step2: Go to appearance in the left wordpress tool bar => click on editor.
Step3: when you are accessing you get announcement that the theme editing is not advisable like that, then you click on “I Understand”. If you click on No, then the wordpress redirect you to admin dashboard page.
Step4: Now in the right column, search function.php files. => click on that
Step5: Now add below mentioned php codes on the function.php as shown in the figure.
add_filter('upload_mimes', 'allow_custom_mimes');
function allow_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;
}
Step6: Save it. In above instead of apk file format you can add any other file format.
$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 |
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 |