我需要在上传 xls 文件时找出文件创建日期和文件上次修改日期,我必须对这两个日期进行一些计算。
通过使用下面的代码,我可以轻松获取文件的上次修改日期。
$('#userfile').bind('change', function() {
//this.files[0].size gets the size of your file.
alert((this.files[0].lastModifiedDate));
alert((this.files[0].DateCreated));
$file_full_path =this.files[0].mozFullPath;
alert(alert);
});
我无法找到文件的创建日期。有人可以帮助我吗?
我也通过 php 尝试过,但通过 php 是不可能的,因为 php 不会将此信息发送到服务器。
请告诉我有什么方法可以获取此信息。 谢谢。
最佳答案
您无法获取创建日期。文件属性中仅提供最后修改日期。
来源: http://forum.jquery.com/topic/jquery-file-creation-date-before-upload
对于 PHP,这里有一个线程提供答案:PHP: how can I get file creation date?
关于javascript - 如何使用 javascript 或 jquery 在浏览器上获取文件创建日期,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27800376/