    async def _put_file(
        self,
        lpath,
        rpath,
        callback=_DEFAULT_CALLBACK,
        chunksize=50 * 2**20,
        max_concurrency=None,
        mode="overwrite",
        **kwargs,
    ):
        """
        mode=="create", exclusive write, is only known to work on AWS S3, and
        requires botocore>1.35.20
        """
        bucket, key, _ = self.split_path(rpath)
        if os.path.isdir(lpath):
            if key:
                # don't make remote "directory"
                return
            else:
                await self._mkdir(lpath)
        size = os.path.getsize(lpath)
        callback.set_size(size)
        if mode == "create":
            match = {"IfNoneMatch": "*"}
        else:
            match = {}

        if "ContentType" not in kwargs:
            content_type, _ = mimetypes.guess_type(lpath)
            if content_type is not None:
                kwargs["ContentType"] = content_type

        with open(lpath, "rb") as f0:
            if size < min(5 * 2**30, 2 * chunksize):
                chunk = f0.read()
                await self._call_s3(
                    "put_object", Bucket=bucket, Key=key, Body=chunk, **kwargs, **match
                )
                callback.relative_update(size)
            else:

                mpu = await self._call_s3(
                    "create_multipart_upload", Bucket=bucket, Key=key, **kwargs
                )
                try:
                    out = await self._upload_file_part_concurrent(
                        bucket,
                        key,
                        mpu,
                        f0,
                        callback=callback,
                        chunksize=chunksize,
                        max_concurrency=max_concurrency,
                    )
                    parts = [
                        {"PartNumber": i + 1, "ETag": o["ETag"]}
                        for i, o in enumerate(out)
                    ]
                    await self._call_s3(
                        "complete_multipart_upload",
                        Bucket=bucket,
                        Key=key,
                        UploadId=mpu["UploadId"],
                        MultipartUpload={"Parts": parts},
                        **match,
                    )
                except Exception:
                    await self._abort_mpu(bucket, key, mpu["UploadId"])
                    raise
        while rpath:
            self.invalidate_cache(rpath)
            rpath = self._parent(rpath)
mode=="create", exclusive write, is only known to work on AWS S3, and
requires botocore>1.35.20
s3fs/core.py