How to get file creation date on browser using javascript or jquery

[亡魂溺海] 提交于 2019-12-02 12:02:19

问题


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 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.

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.


回答1:


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

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

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



来源:https://stackoverflow.com/questions/27800376/how-to-get-file-creation-date-on-browser-using-javascript-or-jquery

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!