diff --git a/apps/files/js/file-upload.js b/apps/files/js/file-upload.js index 1586aa3324..8e72b3cdb4 100644 --- a/apps/files/js/file-upload.js +++ b/apps/files/js/file-upload.js @@ -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 ); },