Only set X-OC-Mtime when browser provided lastModified on upload
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
This commit is contained in:
parent
f39de4ab37
commit
ec8bf53356
|
@ -260,14 +260,22 @@ OC.FileUpload.prototype = {
|
|||
}
|
||||
|
||||
var uid = OC.getCurrentUser().uid;
|
||||
var mtime = this.getFile().lastModified;
|
||||
var size = this.getFile().size;
|
||||
var headers = {};
|
||||
if (mtime) {
|
||||
headers['X-OC-Mtime'] = mtime / 1000;
|
||||
}
|
||||
if (size) {
|
||||
headers['OC-Total-Length'] = size;
|
||||
|
||||
}
|
||||
|
||||
return this.uploader.davClient.move(
|
||||
'uploads/' + encodeURIComponent(uid) + '/' + encodeURIComponent(this.getId()) + '/.file',
|
||||
'files/' + encodeURIComponent(uid) + '/' + OC.joinPaths(this.getFullPath(), this.getFileName()),
|
||||
true,
|
||||
{
|
||||
'X-OC-Mtime': this.getFile().lastModified / 1000,
|
||||
'OC-Total-Length': this.getFile().size
|
||||
}
|
||||
headers
|
||||
);
|
||||
},
|
||||
|
||||
|
|
Loading…
Reference in New Issue