Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2018-01-03 18:18:24 +0300
committerGitHub <noreply@github.com>2018-01-03 18:18:24 +0300
commit876238ce8ba2a9b3c65e53f88806db8e665d6248 (patch)
tree22fe1537b93fabb7ea1f2d556a56047a2e6c6eb5 /apps/files/js/file-upload.js
parentee0653d68b117ac586841465840e629a7c1a487f (diff)
parentec8bf5335618b0b60737ff9a8945d2a835933259 (diff)
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/file-upload.js')
-rw-r--r--apps/files/js/file-upload.js13
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
);
},