Created
June 22, 2019 10:04
-
-
Save cutterkom/652d8ab890857113bc795dd98248587e to your computer and use it in GitHub Desktop.
Uploading a file to Nextcloud from R via webdav
This file contains hidden or 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