Function Reference


_WinAPI_PathIsContentType

Determines if a file's registered content type matches the specified content type

#include <WinAPIShPath.au3>
_WinAPI_PathIsContentType ( $sFilePath, $sType )

Parameters

$sFilePath The file whose content type will be compared.
$sType The content type string. For example, "application/x-msdownload", "image/jpeg", "text/plain", etc.

Return Value

True: the file's content type matches the specified content type.
False: the file's content type do not match.

See Also

Search PathIsContentType in MSDN Library.

Example

#include <Array.au3>
#include <File.au3>
#include <WinAPIShPath.au3>

Local $sFileList = _FileListToArray(@SystemDir, '*.*', 1)
Local $aSortList[UBound($sFileList) - 1]
Local $iCount = 0

For $i = 1 To $sFileList[0]
    If _WinAPI_PathIsContentType($sFileList[$i], 'text/xml') Then
        $aSortList[$iCount] = $sFileList[$i]
        $iCount += 1
    EndIf
Next
If $iCount Then
    ReDim $aSortList[$iCount]
Else
    Exit
EndIf

_ArrayDisplay($aSortList, '_WinAPI_PathIsContentType')