## zowe › rse-api-for-zowe-cli › upload › dir-to-uss

Upload a local directory to a z/OS UNIX System Services directory.

An optional .zosattributes file in the source directory can be used to control file conversion and tagging.

An example .zosattributes file:
# pattern local-encoding remote-encoding
# Don't upload the node_modules directory
.* -
*.jpg binary binary
# Convert CICS Node.js profiles to EBCDIC
*.profile ISO8859-1 EBCDIC

Lines starting with the ‘#’ character are comments. Each line can specify up to three positional attributes:

- A pattern to match a set of files. Pattern-matching syntax follows the same rules as those that apply in .gitignore files (note that negated patterns that begin with ‘!’ are not supported). See https://git-scm.com/docs/gitignore#_pattern_format.
  local-encoding, * A local-encoding to identify a file’s encoding on the local workstation. If '-' is specified for files that match the pattern are not transferred.
- A remote-encoding to specify the file’s desired character set on z/OS UNIX System Services. This attribute must either match the local encoding or be set to EBCDIC. If set to EBCDIC, files are transferred in text mode and converted, otherwise they are transferred in binary mode. Remote files are tagged either with the remote encoding or as binary.

Due to a limitation, files that are transferred in text mode are converted to the default EBCDIC code page on the z/OS system. Therefore the only EBCDIC code page to specify as the remote encoding is the default code page for your system.

A .zosattributes file can either be placed in the top-level directory you want to upload, or its location can be specified by using the --attributes parameter. .zosattributes files that are placed in nested directories are ignored.

#### Usage

zowe rse-api-for-zowe-cli upload dir-to-uss <inputDir> <USSDir> [options]

#### Positional Arguments

- `inputDir` (string)

  - The local directory path that you want to upload to a z/OS UNIX System Services directory

- `USSDir` (string)

  - The name of the z/OS UNIX System Services directory to which you want to upload the local directory

#### Options

- `--attributes` | `--attrs` (string)

  - Path of an attributes file to control how files are uploaded

- `--binary` | `-b` (boolean)

  - Data content in binary mode, which means that no data conversion is performed. The data transfer process returns each record as-is, without translation. No delimiters are added between records.

- `--encoding` | `--ec` (string)

  - Upload the file content with encoding mode, which means that data conversion is performed using the file encoding specified.

- `--max-concurrent-requests` | `--mcr` (number)

  - Specifies the maximum number of concurrent REST API requests to upload files. Increasing the value results in faster uploads. However, increasing the value increases resource consumption on z/OS and can be prone to errors caused by making too many concurrent requests. If the upload process encounters an error, the following message displays:
    The maximum number of TSO address spaces have been created. When you specify 0, Zowe CLI attempts to upload all members at once without a maximum number of concurrent requests.

    Default value: 1

- `--recursive` | `-r` (boolean)

  - Upload all directories recursively.

#### Profile Options

- `--rse-profile` | `--rse-p` (string)

  - The name of a (rse) profile to load for this command execution.

- `--base-profile` | `--base-p` (string)

  - The name of a (base) profile to load for this command execution.

#### Base Connection Options

- `--host` | `-H` (string)

  - Host name of service on the mainframe.

- `--port` | `-P` (number)

  - Port number of service on the mainframe.

- `--user` | `-u` (string)

  - User name to authenticate to service on the mainframe.

- `--password` | `--pass` | `--pw` (string)

  - Password to authenticate to service on the mainframe.

- `--reject-unauthorized` | `--ru` (boolean)

  - Reject self-signed certificates.

    Default value: true

- `--token-type` | `--tt` (string)

  - The type of token to get and use for the API. Omit this option to use the default token type, which is provided by 'zowe auth login'.

- `--token-value` | `--tv` (string)

  - The value of the token to pass to the API.

- `--cert-file` (local file path)

  - The file path to a certificate file to use for authentication.

    Note: The CLI does not support certificate files that require a password. For more information, search Troubleshooting PEM Certificates in Zowe Docs.

- `--cert-key-file` (local file path)

  - The file path to a certificate key file to use for authentication

#### Examples

- Upload all files from the "local_dir" directory to the "/a/ibmuser/my_dir" z/OS UNIX System Services directory:":

  - `zowe rse-api-for-zowe-cli upload dir-to-uss "local_dir" "/a/ibmuser/my_dir"`

- Upload all files from the "local_dir" directory and all its sub-directories, to the "/a/ibmuser/my_dir" z/OS UNIX System Services directory::

  - `zowe rse-api-for-zowe-cli upload dir-to-uss "local_dir" "/a/ibmuser/my_dir" --recursive`