File Uploads Addon

The file uploads addon adds an upload icon to comment boxes, which allows the user to upload a file with their comment.

File CCZif1DiJQ

Supported File Types

A standard WordPress installation typically allows uploading these file types:

  • Images
    • .jpg
    • .jpeg
    • .png
    • .gif
    • .ico
  • Documents
    • .pdf (Portable Document Format; Adobe Acrobat)
    • .doc.docx (Microsoft Word Document)
    • .ppt.pptx.pps.ppsx (Microsoft PowerPoint Presentation)
    • .odt (OpenDocument Text Document)
    • .xls.xlsx (Microsoft Excel Document)
    • .psd (Adobe Photoshop Document)
  • Audio
    • .mp3
    • .m4a
    • .ogg
    • .wav
  • Video
    • .mp4.m4v (MPEG-4)
    • .mov (QuickTime)
    • .wmv (Windows Media Video)
    • .avi
    • .mpg
    • .ogv (Ogg)
    • .3gp (3GPP)
    • .3g2 (3GPP2)

However, it’s not always possible to upload all these file types—some hosting providers limit the set of valid file types and even the maximum file size you can upload in your installation.

Adding File Types

It’s possible to allow additional file types through WordPress’ upload_mimes filter.

function my_custom_mime_types( $mimes ) {
	
        // New allowed mime types.
        $mimes['svg'] = 'image/svg+xml';
	$mimes['svgz'] = 'image/svg+xml';
        $mimes['doc'] = 'application/msword'; 

        // Optional. Remove a mime type.
        unset( $mimes['exe'] );

	return $mimes;
}
add_filter( 'upload_mimes', 'my_custom_mime_types' );

https://codex.wordpress.org/Plugin_API/Filter_Reference/upload_mimes

Scroll to Top