putFile_Request method

BaseRequest putFile_Request(
  1. File file,
  2. FileStat fileStat,
  3. PathUri path, {
  4. DateTime? lastModified,
  5. DateTime? created,
  6. void onProgress(
    1. double progress
    )?,
})

Request to put a new file at path with file as content.

See:

  • putFile for a complete operation executing this request.

Implementation

http.BaseRequest putFile_Request(
  File file,
  FileStat fileStat,
  PathUri path, {
  DateTime? lastModified,
  DateTime? created,
  void Function(double progress)? onProgress,
}) {
  // Authentication and content-type headers are already set by the putStream_Request.
  // No need to set them here.
  return putStream_Request(
    file.openRead(),
    path,
    lastModified: lastModified,
    created: created,
    contentLength: fileStat.size,
    onProgress: onProgress,
  );
}