put
Uploads a file or directory from a local path to a remote path using the appropriate filesystem. It handles both synchronous and asynchronous file system operations.
def put(
from_path: str,
to_path: Optional[str] = None,
recursive: bool = False,
batch_size: Optional[int] = None,
kwargs: Any
) - > str
Uploads a file or directory from a local path to a remote path. If 'to_path' is not provided, a random remote path will be generated.
Parameters
| Name | Type | Description |
|---|---|---|
| from_path | str | The local path to the file or directory to be uploaded. |
| to_path | Optional[str] = None | The remote destination path. If not specified, a random remote path will be generated. |
| recursive | bool = False | A boolean indicating whether to upload directories recursively. |
| batch_size | Optional[int] = None | The number of files to upload in a single batch. If not specified, a default batch size will be used. |
| kwargs | Any | Additional keyword arguments to pass to the underlying filesystem's put method. |
Returns
| Type | Description |
|---|---|
str | The remote path where the file or directory was uploaded. |