diff options
author | Morris Jobke <hey@morrisjobke.de> | 2018-01-03 16:18:24 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-01-03 16:18:24 +0100 |
commit | 876238ce8ba2a9b3c65e53f88806db8e665d6248 (patch) | |
tree | 22fe1537b93fabb7ea1f2d556a56047a2e6c6eb5 /apps/files/js | |
parent | ee0653d68b117ac586841465840e629a7c1a487f (diff) | |
parent | ec8bf5335618b0b60737ff9a8945d2a835933259 (diff) | |
download | nextcloud-server-876238ce8ba2a9b3c65e53f88806db8e665d6248.tar.gz nextcloud-server-876238ce8ba2a9b3c65e53f88806db8e665d6248.zip |
Merge pull request #7533 from nextcloud/oc-28545-handle-oc-total-length-in-new-chunking
[oc] Handle OC-Total-Length in new chunking
Diffstat (limited to 'apps/files/js')
-rw-r--r-- | apps/files/js/file-upload.js | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/apps/files/js/file-upload.js b/apps/files/js/file-upload.js index e9534111e10..8e95abcb5e8 100644 --- a/apps/files/js/file-upload.js +++ b/apps/files/js/file-upload.js @@ -260,11 +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} + headers ); }, |