Anonymous upload via curl

I am trying to get a file uploaded anonymously. I have created a folder for that, and when I use the link in the webbrowser, I can drag and drop a file into the upload folder without being logged in. Fine.

Now I want to do the same with curl, but I don’t get the path constructed in a correct way.

I have tried variants such as

curl -k -T test.txt -u “93cQrfR3aHwNaeK:” -H ‘X-Requested-With: XMLHttpRequest’ https://<xxx.yyy.com>/public.php/dav/

curl -k -T test.txt -u “93cQrfR3aHwNaeK:” -H ‘X-Requested-With: XMLHttpRequest’ https://<xxx.yyy.com>/index.php/s/test.txt

curl -k -T test.txt -u “93cQrfR3aHwNaeK:” -H ‘X-Requested-With: XMLHttpRequest’ https://<xxx.yyy.com>/remote.php/s/test.txt

But nothing seems to work. Most probably a very simple error. Can you please help?

I think you’re looking for /public.php/webdav/targetfile.

Something like:

curl -u 'SXXXXXXXXXX:' -T blah.bin "https://nc-test.tld/public.php/webdav/blah.bin"

3 Likes

@jtr

Yes, thanks a lot, this is excatly what I was looking for.

Seems that I got lost in the documentation. Thank you!
tfv

1 Like