I have many .pdf files from attachments that were emailed to me by police and court of apeal (not shared via FTP) and I have the old HDD blocked so that I had to download them in same day and creation date is same with modification date, so I was wondering if it was possible to find out the date and/or time it was originally created after they are shared in a private ftp folder and listed in php? Everything I’ve tried to date just gives me the date/time that I download the attachment. All the files are smaller then 10MB so that I would need just a line of code to read the /CreationDate
entry via file_get_contents()
and not a class or an API with tons of files and bytes.
<?php
$date = array(); $sourcefile = "./file.pdf";
$stringedPDF = file_get_contents($sourcefile, true);
preg_match('/(?<=CreationDate )S(?:(?<=().+?(?=))|(?<=[).+?(?=]))./', $stringedPDF, $date);
echo $all = $date[0];