PHP Classes

PHP Windows File Attributes: Get the type and other properties of Windows files

Recommend this page to a friend!
  Info   View files Example   Screenshots Screenshots   View files View files (4)   DownloadInstall with Composer Download .zip   Reputation   Support forum (1)   Blog    
Ratings Unique User Downloads Download Rankings
Not enough user ratingsTotal: 150 This week: 1All time: 9,080 This week: 560Up
Version License PHP version Categories
windows-file-propert 1.2GNU General Publi...5PHP 5, Files and Folders, Windows
Description 

Author

This package can be used to get the type and other properties of Windows files.

It can take the file name of a path and retrieves several types of properties of the file. Currently it can retrieve the file:

- Size in bytes
- Type
- Name
- Path
- Extension (.exe,...)
- Version

Innovation Award
PHP Programming Innovation award nominee
February 2020
Number 5
Many PHP developers work on sites that need to run on servers based on Windows.

Sometimes it is necessary to obtain certain types of information about files available on a Windows system.

Such types of information are not available using the built-in PHP functions dedicated to check files.

This package provides an alternative solution that uses a Windows COM object to inspect those Windows specific types of information.

Manuel Lemos
Picture of Hassane Moussa
  Performance   Level  
Name: Hassane Moussa <contact>
Classes: 10 packages by
Country: Niger Niger
Age: 40
All time rank: 21481 in Niger Niger
Week rank: 106 Up1 in Niger Niger Equal
Innovation award
Innovation award
Nominee: 2x

Winner: 1x

Recommendations

.exe Parser
Is possible parse Windows a .exe file?

Example

<?php
/****************************************************************************************************************
                            Main Using Class WindowsFileProperties
                           
                                Below the prerequises
                            See COM Requirements:
                                COM functions are only available for the Windows version of PHP.
                                    .Net support requires PHP 5 and the .Net runtime.
                                Enable the module COM and .NET extension in PHP :: extension=php_com_dotnet.dll
                            PHP 5 or newer
****************************************************************************************************************/
 
require('windowsFileProperties.php');
 
   
$path = "D:\\wamp\\www\\windowsFileProperties\\TeamViewer10_Setup_fr.exe"; // For Example

   
$objectCom = new windowsFileProperties($path); // create objet
   
   
echo $objectCom->getStdoutHtml(); // Example to display all get() method functions in HTML
   
echo "<br>/*********************Example of Call all functions*************************/<br><br>";
   
                 echo
$objectCom->getRealFileName()."<br>"; // File Name
                
echo $objectCom->getRealFileVersion()."<br>"; // File Version
                
echo $objectCom->getRealFileSize()."<br>"; // File Size
                
echo $objectCom->getRealFileType()."<br>"; // File Type
                
echo $objectCom->getRealFileExtension()."<br>"; // File Extension
                
echo $objectCom->getRealFilePath(); // File Path
  
?>


Details

Windows-File-Properties Class PHP

Get the type and other properties of Windows files. This package can be used to get the type and other properties of Windows files.

It can take the file name of a path and retrieves several types of properties of the file. Currently it can retrieve the file:

  • Size in bytes
  • Type
  • Name
  • Path
  • Extension (.exe,...)
  • Version

Before used this class, below the prerequises

See COM Requirements: COM functions are only available for the Windows version of PHP. .Net support requires PHP 5 and the .Net runtime. Enable the module COM and .NET extension in PHP :: extension=php_com_dotnet.dll

PHP 5 or newer * @author Hassane Moussa * @From Africa / Niamey-Niger


Screenshots  
  • Example.JPG
  Files folder image Files  
File Role Description
Accessible without login Plain text file index.php Example Example script
Accessible without login Plain text file LICENSE Lic. License text
Accessible without login Plain text file README.md Doc. Documentation
Plain text file windowsFileProperties.php Class Class source

 Version Control Unique User Downloads Download Rankings  
 100%
Total:150
This week:1
All time:9,080
This week:560Up
User Comments (1)