socketio-file-upload icon indicating copy to clipboard operation
socketio-file-upload copied to clipboard

Microsoft Edge file object missing lastModified

Open TroyWolf opened this issue 7 years ago • 1 comments

This is not an issue with socketio-file-upload, but is an issue others may run into when uploading files.

I found that my Microsoft Edge users would end up with files on my server with junk timestamps. In my case, I have a process that rsyncs the files to another location and preserves timestamps. rsync would fail with a message like the one below--substitute your file name.

Time value of %s truncated on receiver.

The issue is that Edge does not follow the spec for the File Object as explained here: https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/4155006/

In short, the object is missing the "lastModified" property that normally holds the unix time value. In my own code, I was able to account for this by adding this bit of code in my function where I handle each file object:

if (!file.lastModified) { file.lastModified = file.lastModifiedDate.getTime(); }

Arguably, socketio-file-upload client could do this same thing internally.

TroyWolf avatar Dec 19 '17 20:12 TroyWolf

Thanks for the report. Unfortunately I don't have easy access to Microsoft Edge to test this.

Can you send a PR?

sffc avatar Jul 05 '18 22:07 sffc