Datei per curl vom Console nach Owncloud / Nextcloud hochladen

Wie bekomme ich eigentlich eine Datei per Console vom Server zu einem Owncloud oder Nextcloud hochgeladen?

curl hilft dabei, es geht z.B. so:

curl -X PUT -u username:password "http://myserver/remote.php/webdav/filename.type" --data-binary @"filename.type"

curl: show header only / http get

If you only want to show the headers of your http response, you may want to use the following switches:

  • -D = dump headers
  • -s = silent mode
  • -o /dev/null = send all output do dev null

The curl request looks like this:

$ curl -s -D - -o /dev/null

The output should looks like this:

HTTP/2 200
last-modified: Tue, 13 Dec 2016 12:08:30 GMT
etag: W/"183836-1481630910000"
server: Apache
x-magnolia-registration: Registered
pragma: no-cache
content-type: application/x-font-otf;charset=UTF-8
content-length: 183836
accept-ranges: bytes
cache-control: public, max-age=8236
expires: Mon, 02 Jan 2017 13:11:32 GMT
date: Mon, 02 Jan 2017 10:54:16 GMT