---
type: concept
title: CLI/Scripted Uploads
created: 2026-07-01
updated: 2026-07-01
tags: [automation, webdav, curl, nextcloud]
related: [nextcloud]
sources: ["output/rz_uni_greifswald_de_dienste_webdienste_nextcloud_faq_nextcloud.md"]
---

# CLI/Scripted Uploads

CLI/Scripted uploads allow for the headless transfer of files to a Nextcloud instance using a share link and password, bypassing the graphical user interface.

## Implementation via WebDAV
Nextcloud provides a specific WebDAV endpoint for public shares: `https://nextcloud.uni-greifswald.de/public.php/webdav/`.

### Using curl
The `curl` utility can be used to perform the upload. The request must include a specific header (`X-Requested-With: XMLHttpRequest`) to be accepted by the server.

**Syntax:**
```bash
curl -u "TOKEN:PASSWORD" -T "FILE_PATH" -H 'X-Requested-With: XMLHttpRequest' https://nextcloud.uni-greifswald.de/public.php/webdav/
```

**Key Parameters:**
- **TOKEN**: The unique alphanumeric string at the end of the Nextcloud share link.
- **PASSWORD**: The password set for the share. If no password is set, the format must be `"TOKEN:"` (with the trailing colon).
- **-T**: Specifies the local file to be uploaded.
- **Header**: The `X-Requested-With` header is mandatory for this endpoint.