put
Uploads a file or directory from a local path to a specified or automatically generated remote destination path using the underlying filesystem. Performs I/O operations asynchronously or synchronously depending on the underlying filesystem implementation.
async def put(
from_path: str,
to_path: Optional[str] = None,
recursive: bool = False,
batch_size: Optional[int] = None,
**kwargs,
) -> str: ...
Uploads a local file or directory to a specified or auto-generated remote storage path using the appropriate underlying filesystem. Handles both asynchronous and synchronous filesystems to perform the transfer.
Parameters
| Name | Type | Description |
|---|---|---|
| from_path | str | The local source file or directory path to be uploaded. |
| to_path | Optional[str] = None | The destination path in remote storage. If omitted or None, a random remote path is generated based on the source filename. |
| recursive | bool = False | Whether to recursively upload contents if the source path is a directory. |
| batch_size | Optional[int] = None | The number of concurrent operations or batch size to use during the upload when supported by the filesystem. Falls back to a default batch size if not specified. |
| **kwargs | Any | Additional keyword arguments passed directly to the underlying filesystem's put operation. |
Returns
| Type | Description |
|---|---|
str | The destination file or directory path where the content was uploaded. |