Is it possible to get the date that a file was uploaded to FTP? Not created.
Its use will be in a system where I upload files for a client to view which will appear on a dynamic page and need to be timestamped with when they were last changed.
I basically need to get the time that the file had finished transferring onto FTP - via an FTP client, uploaded by me.
Use PHP's stat() function. It returns every data that you'll need to know.
http://php.net/manual/en/function.stat.php
<?php
/* Get file stat */
$stat = stat('C:\php\php.exe');
/*
* Print file access time, this is the same
* as calling fileatime()
*/
echo 'Access time: ' . $stat['atime'];
/*
* Print file modification time, this is the
* same as calling filemtime()
*/
echo 'Modification time: ' . $stat['mtime'];
/* Print the device number */
echo 'Device number: ' . $stat['dev'];
?>
I think that in your case "file modification time" is the answer.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With