是否有可能获取文件的日期为上传到FTP? 未创建。PHP - 获取上传文件传输完成的时间戳
它的用途将在一个系统中,我上传一个客户端的文件,以查看哪些将出现在动态页面上,并需要在上次更改时加盖时间戳。
我基本上需要得到文件传输到FTP上的时间 - 通过FTP客户端,由我上传。
是否有可能获取文件的日期为上传到FTP? 未创建。PHP - 获取上传文件传输完成的时间戳
它的用途将在一个系统中,我上传一个客户端的文件,以查看哪些将出现在动态页面上,并需要在上次更改时加盖时间戳。
我基本上需要得到文件传输到FTP上的时间 - 通过FTP客户端,由我上传。
使用PHP的stat()函数。它会返回您需要知道的每个数据。
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'];
?>
我认为你的情况 “文件修改时间” 就是答案。
有趣的是,在我的情况下,每次上传文件时,我都将原始名称和上传的数据保存在数据库中,而这样的 – Ibu 2011-05-16 04:41:31
啊,我的意思是通过FTP上传。所以我用FTP客户端将文件拖到服务器上,我想显示上传完成的时间。 – Marty 2011-05-16 04:42:40