putStream method

Future<StreamedResponse> putStream(
  1. Stream<List<int>> localData,
  2. PathUri path, {
  3. DateTime? lastModified,
  4. DateTime? created,
  5. int? contentLength,
  6. void onProgress(
    1. double progress
    )?,
})

Puts a new file at path with localData as content.

lastModified sets the date when the file was last modified on the server. 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:

Implementation

Future<http.StreamedResponse> putStream(
  Stream<List<int>> localData,
  PathUri path, {
  DateTime? lastModified,
  DateTime? created,
  int? contentLength,
  void Function(double progress)? onProgress,
}) {
  final request = putStream_Request(
    localData,
    path,
    lastModified: lastModified,
    created: created,
    contentLength: contentLength,
    onProgress: onProgress,
  );

  return csrfClient.send(request);
}