putFile_Request method
StreamedRequest
putFile_Request(})
Returns a request to put a new file at path with file 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.
checksum has to follow checksumPattern. It will not be validated by the server.
onProgress can be used to watch the upload progress. Possible values range from 0.0 to 1.0.
See:
- http://www.webdav.org/specs/rfc2518.html#METHOD_PUT for more information.
- putFile for a complete operation executing this request.
Implementation
http.StreamedRequest putFile_Request(
File file,
FileStat fileStat,
PathUri path, {
DateTime? lastModified,
DateTime? created,
String? checksum,
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,
checksum: checksum,
contentLength: fileStat.size,
onProgress: onProgress,
);
}