Reputation: 963
In windows explorer their is a summary tab that contains, title, subject, author, category, keywords, and comments for every file. Is it possible to read and edit this data using php?
Upvotes: 5
Views: 2385
Reputation: 13188
You can't get meaningful metadata with PHP in windows for many applications. The only real exception for this would be using PHP's Component Object Model.
Reference
Here is an example for word / excel:
// for MSExcel use:
$objOfficeApp = new COM("excel.application") or die("unable to instantiate MSExcel");
// for MSWord use:
//$objOfficeApp = new COM("word.application") or die("unable to instantiate MSWord");
$objOfficeApp->Workbooks->Open( "c:\\temp\\test.xls" );
//$objOfficeApp->Documents->Open( "c:\\temp\\test.doc" );
$objDocProps = $objOfficeApp->ActiveWorkBook->BuiltInDocumentProperties();
//$objDocProps = $objOfficeApp->ActiveDocument->BuiltInDocumentProperties();
$count = $objDocProps->count();
while( $objDocProp = $objDocProps->Next() ) {
print $objDocProp->Name() . ': ' . $objDocProp->Value() . "\n";
}
unset($objDocProp);
unset($objDocProps);
$objOfficeApp->ActiveWorkBook->Close();
//$objOfficeApp->ActiveDocument->Close();
$objOfficeApp->Quit();
unset($objOfficeApp);
Upvotes: 2