You can accomplish this (for any file of any type) by shelling out to the command line and executing a DIR /Q command on the file:
$output = shell_exec('dir ' . $filepath . '/Q');
$output = explode(' ', $output);
foreach($output as $entry) {
if(strtoupper($entry) == '{DOMAIN}\\' . strtoupper($loggedInUser)) {
$owner = str_replace('{DOMAIN}\\', '', $entry);
}
}
This functions properly only a Windows system while the native PHP function fileOwner
functions properly only on a linux system.
Where I work, we have a PHP extension that somehow extracts this information with a single function call but I have no idea how it works.