Nextcloud version (eg, 10.0.2): 11
Operating system and version (eg, Ubuntu 16.04): 16.04
Apache or nginx version (eg, Apache 2.4.25): 2.4.18
PHP version (eg, 5.6): 7.0.15
Is it possible to upload to a Nextcloud “File Drop” using curl from a command line? I have tried:
curl -T fileToUpload https://nextcloud.mysite.com/s/gL8JS945tRZbGZF
curl -X PUT https://nextcloud.mysite.com/s/gL8JS945tRZbGZF --data-binary @"/tmp/test"
And I have even gone in to Chrome’s developer console, watched a sample file get uploaded and copied the curl command, which does not work, but is something like:
curl 'https://nextcloud.mysite.com/public.php/webdav/test_file.jpg' -X PUT -H 'Origin: https://nextcloud.mysite.com' -H 'Accept-Encoding: gzip, deflate, sdch, br' -H 'Accept-Language: en-US,en;q=0.8' -H 'Authorization: Basic Z0w4SlM5NDV0UlpiR1pGOg==' -H 'OCS-APIREQUEST: true' -H 'Content-Type: image/jpeg' -H 'Accept: */*' -H 'X-Requested-With: XMLHttpRequest' -H 'Content-Disposition: attachment; filename="test_file.jpg"' -H 'Connection: keep-alive' -H 'User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.81 Safari/537.36' -H 'Content-Length: 106717' --compressed
None of this seems to work. It seems like there should be a way to get this working that isn’t too crazy. I appreciate any help anyone can provide.