上传 .wma 文件失败-WordPress问题论坛-WordPress-光子社区 | 技术交流与生活分享的理想平台
3
share (joys, benefits, privileges etc) with others

Failed to upload .wma file

Somebody, help me.

I'm uploading a .wma file in WordPress and I'm getting the error "This file type is not allowed".

But I've added support for .wma file types as follows:

 // Add this filter to allow mime file uploads
   add_filter('upload_mimes', array($this, 'allow_mime_uploads'));

    public function allow_mime_uploads($mimes) {
        $mimes['epub'] = 'application/epub+zip';
        $mimes['djvu'] = 'image/vnd.djvu';
        $mimes['jfif'] = 'image/jpeg';
        $mimes['htm'] = 'text/html';
        $mimes['html'] = 'text/html'.
        $mimes['svg'] = 'image/svg+xml';
        $mimes['eps'] = 'application/postscript';
                $mimes['psd'] = 'image/vnd.adobe.photoshop';
                $mimes['mobi'] = 'application/x-mobipocket-ebook';
                $mimes['vob'] = 'video/dvd';
                $mimes['dwg'] = 'image/vnd.dwg';
                $mimes['wma'] = 'audio/x-ms-wma';

        return $mimes;
    }  

.dwg, however, can be uploaded after adding the mime type, but .wma cannot.

d2b5ca33bd20240821175217

 

Please log in to post a comment

    return (to a previous condition)2
    See only the author.