如何使用javascript或jquery在浏览器上获取文件创建日期 [英] How to get file creation date on browser using javascript or jquery

查看:196
本文介绍了如何使用javascript或jquery在浏览器上获取文件创建日期的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要在上传xls文件时找出文件创建日期和文件上次修改日期,我必须在这两个日期做一些计算。

I need to find out the file creation date and file last modified date while uploading the xls file, I have to do some calculation on this 2 dates.

By使用下面的代码,我可以很容易地获得文件的最后修改日期。

By using below code I can easily get file last modified date.

$('#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);
});

我无法找到文件创建日期。任何人都可以帮助我。

I am not able to find out the the file creation date. can anybody please help me.

我也通过php尝试过但是不可能通过php,因为php不会将此信息发送到服务器。

I have also tried it via php but it is not possible via php because php doesn't send this information to server.

请告诉我有没有办法获取这些信息。
谢谢。

Please tell me is there any way to get this information. Thanks.

推荐答案

您无法获得创建日期。文件属性中只有最后修改日期可用。

You can not get the creation date. Only the last modified date is available in file properties.

来源:
http://forum.jquery.com/topic/jquery-file-creation-date-before-upload

对于PHP,这里有一个提供答案的线程: PHP:我怎样才能获得文件创建日期?

For PHP there is a thread here that provides answer: PHP: how can I get file creation date?

这篇关于如何使用javascript或jquery在浏览器上获取文件创建日期的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆