Skip to content
Snippets Groups Projects
Commit 1c623921 authored by Reiter, Christoph's avatar Reiter, Christoph :snake:
Browse files

webdav: Explicitely pass contentLength to putFileContents()

This option doesn't exist in webdav.client 3.x but is required in 4.x
due to https://github.com/perry-mitchell/webdav-client/issues/266

This will switching between versions easier.
parent 7de563f5
No related branches found
No related tags found
No related merge requests found
...@@ -663,8 +663,10 @@ export class NextcloudFilePicker extends ScopedElementsMixin(DBPLitElement) { ...@@ -663,8 +663,10 @@ export class NextcloudFilePicker extends ScopedElementsMixin(DBPLitElement) {
let that = this; let that = this;
this.loading = true; this.loading = true;
this.statusText = i18n.t('nextcloud-file-picker.upload-to', {path: path}); this.statusText = i18n.t('nextcloud-file-picker.upload-to', {path: path});
// contentLength: https://github.com/perry-mitchell/webdav-client/issues/266
await this.webDavClient await this.webDavClient
.putFileContents(path, file, { .putFileContents(path, file, {
contentLength: file.size,
overwrite: false, onUploadProgress: progress => { overwrite: false, onUploadProgress: progress => {
/* console.log(`Uploaded ${progress.loaded} bytes of ${progress.total}`);*/ /* console.log(`Uploaded ${progress.loaded} bytes of ${progress.total}`);*/
} }
...@@ -744,8 +746,10 @@ export class NextcloudFilePicker extends ScopedElementsMixin(DBPLitElement) { ...@@ -744,8 +746,10 @@ export class NextcloudFilePicker extends ScopedElementsMixin(DBPLitElement) {
let that = this; let that = this;
// https://github.com/perry-mitchell/webdav-client#putfilecontents // https://github.com/perry-mitchell/webdav-client#putfilecontents
// contentLength: https://github.com/perry-mitchell/webdav-client/issues/266
await this.webDavClient await this.webDavClient
.putFileContents(path, file, { .putFileContents(path, file, {
contentLength: file.size,
overwrite: overwrite, onUploadProgress: progress => { overwrite: overwrite, onUploadProgress: progress => {
/*console.log(`Uploaded ${progress.loaded} bytes of ${progress.total}`);*/ /*console.log(`Uploaded ${progress.loaded} bytes of ${progress.total}`);*/
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment