diff --git a/packages/neon/neon_files/lib/src/utils/task.dart b/packages/neon/neon_files/lib/src/utils/task.dart index dbe8270161f..e86200a1285 100644 --- a/packages/neon/neon_files/lib/src/utils/task.dart +++ b/packages/neon/neon_files/lib/src/utils/task.dart @@ -128,7 +128,7 @@ class FilesUploadTaskMemory extends FilesTaskMemory implements FilesUploadTask { } @override - final int? size; + final int size; @override final tz.TZDateTime? lastModified; @@ -138,6 +138,7 @@ class FilesUploadTaskMemory extends FilesTaskMemory implements FilesUploadTask { _stream.stream, uri, lastModified: lastModified, + contentLength: size, onProgress: progressController.add, ); await progressController.close(); diff --git a/packages/nextcloud/lib/src/webdav/client.dart b/packages/nextcloud/lib/src/webdav/client.dart index 50b09c25139..db1628c4527 100644 --- a/packages/nextcloud/lib/src/webdav/client.dart +++ b/packages/nextcloud/lib/src/webdav/client.dart @@ -142,6 +142,9 @@ class WebDavClient { /// Request to put a new file at [path] with [localData] as content. /// + /// Setting [contentLength] is important because some web servers will consider the file to be empty otherwise. + /// It will be required in the next major release. + /// /// See: /// * [putStream] for a complete operation executing this request. http.BaseRequest putStream_Request( @@ -187,6 +190,9 @@ class WebDavClient { /// [created] sets the date when the file was created on the server. /// [contentLength] sets the length of the [localData] that is uploaded. /// [onProgress] can be used to watch the upload progress. Possible values range from 0.0 to 1.0. [contentLength] needs to be set for it to work. + /// Setting [contentLength] is important because some web servers will consider the file to be empty otherwise. + /// It will be required in the next major release. + /// /// See: /// * http://www.webdav.org/specs/rfc2518.html#METHOD_PUT for more information. /// * [putStream_Request] for the request sent by this method.