Upload file which contain no extension into wordpress? Upload file which contain no extension into wordpress? wordpress wordpress

Upload file which contain no extension into wordpress?


The real problem is not with WordPress's backend but it's frontend validation. The uploader is handled by Plupload and by default, WordPress is only checking if you have defined ALLOW_UNFILTERED_UPLOADS in the uploading progress, without really tweaking the frontend plugin's filter validation with the value. Perhaps a small frontend glitch.

As you can see, WordPress is always rendering the following default settings:

var _wpPluploadSettings = {"defaults":{"file_data_name":"async-upload","url":"\/wp-admin\/async-upload.php","filters":{"max_file_size":"268435456b","mime_types":[{"extensions":"jpg,jpeg,jpe,gif,png,bmp,tiff,tif,ico,asf,asx,wmv,wmx,wm,avi,divx,flv,mov,qt,mpeg,mpg,mpe,mp4,m4v,ogv,webm,mkv,3gp,3gpp,3g2,3gp2,txt,asc,c,cc,h,srt,csv,tsv,ics,rtx,css,htm,html,vtt,dfxp,mp3,m4a,m4b,ra,ram,wav,ogg,oga,flac,mid,midi,wma,wax,mka,rtf,js,pdf,class,tar,zip,gz,gzip,rar,7z,psd,xcf,doc,pot,pps,ppt,wri,xla,xls,xlt,xlw,mdb,mpp,docx,docm,dotx,dotm,xlsx,xlsm,xlsb,xltx,xltm,xlam,pptx,pptm,ppsx,ppsm,potx,potm,ppam,sldx,sldm,onetoc,onetoc2,onetmp,onepkg,oxps,xps,odt,odp,ods,odg,odc,odb,odf,wp,wpd,key,numbers,pages"}]},"multipart_params":{"action":"upload-attachment","_wpnonce":"9ee7fbf228"}},"browser":{"mobile":false,"supported":true},"limitExceeded":false};

A temporary fix to the problem before they fix it on their end would be hooking in the filters WordPress is calling to generate the frontend settings, plupload_default_settings.

Add the filter in your functions.php:

add_filter('plupload_default_settings', function ($settings) {    if (defined('ALLOW_UNFILTERED_UPLOADS') && ALLOW_UNFILTERED_UPLOADS) {        unset($settings['filters']['mime_types']);    }    return $settings;});

This will allow you to upload your test via the uploader. Since WordPress is checking already in the backend, as long as you have defined it in your wp-config.php that ALLOW_UNFILTERED_UPLOADS is true, it should be uploaded properly.


Make sure there isn't a security plugin or other plugin that overrides your define('ALLOW_UNFILTERED_UPLOADS', true); :)

I would suggest first to scan for ALLOW_UNFILTERED_UPLOADS through your site files and see what pops up.

Also update to latest version of WordPress if you haven't already, since the error message you are getting is different from the one I get.


You do not want to paste this into your /functions.php file but in your /wp-config.php file.

Alternatively, you can create MIME's for specific file types by pasting this into your /functions.php file, like you have done.