Upload a file to ocis with cURL

I am trying to upload a file via cURL to ocis. I read somewhere that the dav endpoints from ownCloud 10 can also be used with ocis. The used command is from the documentation for ownCloud 10:

curl -u user:pass -T error.log \
  "https://example.com/remote.php/dav/files/USERNAME/error.log"

It looks like cURL indeed is uploading something to somewhere and then exits without an error. But the file doesn’t show up in the webinterface nor in the servers filesystem storage folder of the according user.

Is this not possible yet? I am also not able to add a webdav client (documents on iOS) to ocis. What am I doing wrong?

Did you figure this one out?

You might want to take a look at How to Authenticate to the WebDAV API? - #6 by rkaussow

2 Likes

Thanks for this.
It is rather complicated compared to the approach with ownCloud 10…

It is actually very easy. What you want to do is:

1. Create a "Space" and call it "Backup" for example
2. Create a folder inside that space and call it "Database" for example
3. Under "Actions" of folder "Database" click on "Copy quicklink"
4. Choose "Uploader" insted on "Viewer" bellow your quicklink
5. Your quicklink will look like this: https://example.com/s/JBUbSIDEcmQeqhl 
6. Note the part after /s/
7. curl -T error.log https://example.com/remote.php/dav/public-files/JBUbSIDEcmQeqhl/
8. Profit
5 Likes