Uploading files through API

(Using Nextcloud 15)

Hi. We want to create a script that use the NextCloud API to upload a file. Right now we’ve tried using the API at:

This let us upload files such as .txt by having the script take the content of the file and use that content in the raw body of the curl request. However this doesn’t seem to work as good with other file types (for example .pdf).

Is there another API call for uploading files to Nextcloud? Or any other alternative ways?

You could upload files with cURL using WebDAV:

1 Like

I’m trying to upload the image file through API, it is uploading the file but the file content is not visible there.