Filter CQWP by File Type:

Open the “.webpart” file in a text editor. (I use SharePoint Designer)

Look for the following line: <property name="CommonViewFields" type="string" />

Replace it with the following line:<property name="CommonViewFields" type="string">DocIcon,Lookup</property>This will make the CQWP retrieve also the DocIcon field that basically include the file extention.

Look for the following line:<property name="AdditionalFilterFields" type="Lookup" null="true" />

Replace it with the following line:<property name="AdditionalFilterFields" type="Lookup" >DocIcon</property>This will make our CQWP to allow you to filter by our newly added DocIcon field through the filtering UI in the web part’s toolpane.

Create a new style in the itemstyle.xsl and include the following where you want the file size to appear:<xsl:call-template name=”DisplaySize”><xsl:with-param name=”size” select=”size” /></xsl:call-template>