megatools-put(1)
================

NAME
----
megatools put - upload files to your Mega.nz account


SYNOPSIS
--------
[verse]
'megatools put' [--no-progress] [--overwrite] [--path <remotepath>] <paths>...


DESCRIPTION
-----------

Uploads files to your Mega.nz account, by default into /Root. Only regular
files can be uploaded (or symbolic links to them); directories, FIFOs and
devices are refused.

*NOTE*: To upload entire directories, use man:megatools-copy[1].

*NOTE*: Uploading to shared folders under /Shared is only possible if the
share owner granted you write access. Read-only shares are rejected with an
error.


OPTIONS
-------

--path <remotepath>::
	Remote path to upload to (default: /Root). If this path is a folder,
	the files are placed into it. If it doesn't exist, and its parent
	folder does, the file is uploaded under this name (this only works
	with exactly one file).

--overwrite::
	Replace a remote file that already exists at the destination, instead
	of failing. The replaced file becomes the previous version of the new
	one, as when replacing a file in the webclient (unless file versioning
	is disabled in the account settings, then mega.nz deletes it).
	Previous versions are not listed by megatools.

--no-progress::
	Disable upload progress reporting.

include::upload-options.txt[]
include::auth-options.txt[]
include::basic-options.txt[]


<paths>::
	One or more local files to upload.


EXIT STATUS
-----------

0 when all files were uploaded, 2 when a file already exists at the
destination (and `--overwrite` wasn't given), 1 when an upload failed for
another reason. With several files, 1 wins over 2.


EXAMPLES
--------

* Upload a file to /Root:
+
------------
$ megatools put README
Uploaded README
$ megatools ls /Root
/Root
/Root/README
------------


* Upload a file under another name:
+
------------
$ megatools put --path /Root/README.TXT README
------------


* Upload several files into a folder:
+
------------
$ megatools mkdir /Root/Photos
$ megatools put --path /Root/Photos *.jpg
------------


* Upload a new version of a file:
+
------------
$ megatools put README
ERROR: Upload failed for 'README': File already exists: /Root/README
$ megatools put --overwrite README
Uploaded README
------------


include::remote-paths.txt[]

include::footer.txt[]
