Tag Archives: curl

WebDAV with cURL

Assuming the following Data:

  • Webdav URL: http://example.com/webdav
  • Username: user
  • Password: pass

Actions

Reading Files/Folders

Creating new Folder

Uploading File

1
curl -T '/path/to/local/file.txt' 'http://example.com/webdav/test/new_name.txt'

Renaming File

Deleting Files/Folders

File:

Folder:

List Files in a Folder

1
2
3
4
5
6
curl -i -X PROPFIND http://example.com/webdav/ --upload-file - -H "Depth: 1" <<end
<?xml version="1.0"?>
<a:propfind xmlns:a="DAV:">
<a:prop><a:resourcetype/></a:prop>
</a:propfind>
end

Continue reading WebDAV with cURL