Uploading a file to Nextcloud from R via webdav
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
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