Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Uploading a file to Nextcloud from R via webdav
library(httr)
# webdav target and login
dav <- "https://your-nextcloud.com/remote.php/webdav"
username <- "<username>"
password <- "<password>"
# the file to upload
img <- "image.png"
# create the url target of the file
url <- file.path(dav, img)
# webdav uses a PUT request to send a file to Nextcloud
PUT(url, authenticate(username, password), body = upload_file(file.path(img)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment