Upload a file
(self, file)
| 1720 | |
| 1721 | @CLIUtil.addcommand(spaces=True) |
| 1722 | def put(self, file): |
| 1723 | """ |
| 1724 | Upload a file |
| 1725 | """ |
| 1726 | if self._require_share(): |
| 1727 | return |
| 1728 | local_file = self.localpwd / file |
| 1729 | if local_file.is_dir(): |
| 1730 | # Directory |
| 1731 | raise ValueError("put on dir not impl") |
| 1732 | else: |
| 1733 | fname = pathlib.Path(file).name |
| 1734 | with local_file.open("rb") as fd: |
| 1735 | size = self._send_file(fname, fd) |
| 1736 | self.ls_cache.clear() |
| 1737 | return fname, size |
| 1738 | |
| 1739 | @CLIUtil.addcomplete(put) |
| 1740 | def put_complete(self, folder): |