Created
October 16, 2020 14:47
-
-
Save marc-hanheide/44fe2fc550d8e4788d78ffc427242b0e to your computer and use it in GitHub Desktop.
CURL upload to NextCloud shared folder
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
FILEPATH="$1" | |
SHARED_TOKEN="Xp749RSG2K4NknT" | |
URL="https://lcas.lincoln.ac.uk/nextcloud/public.php/webdav" | |
FILENAME="`basename $FILEPATH`" | |
curl -X PUT -T "$FILEPATH" -u "$SHARED_TOKEN:" $URL/$FILENAME |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
to download, you can use:
curl -o test.md -u "tWP5TiR9wxf3xAD:" https://lcas.lincoln.ac.uk/nextcloud/public.php/webdav
with the share token ordirectly do
curl -o test.md https://lcas.lincoln.ac.uk/nextcloud/index.php/s/tWP5TiR9wxf3xAD/download
, where/download
is appended to the full share URL of a file