PHP Classes

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

Recommend this page to a friend!
  Info   Example   Screenshots   View files Files   Install with Composer Install with Composer   Download Download   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not enough user ratingsTotal: 150 All time: 9,088 This week: 488Up
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
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 (1)  
  • Example.JPG
  Files folder image Files (5)  
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

The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page.
Install with Composer Install with Composer
 Version Control Unique User Downloads Download Rankings  
 100%
Total:150
This week:0
All time:9,088
This week:488Up
User Comments (1)