

Commonly used Authentications in case of webdav are : Basic and Digest.
#WEBDAV CLIENT LINUX PASSWORD#
To specify username and password for webdav, use '-user' or use alias '-u': curl -user 'user:pass' ''Īuthentication is the ability to tell the server your username and password so that it can verify that you're allowed to do the request you're doing. In this article we will focus on few necessary options required for basic webdav access. Let's say src file is /path/to/local/file.txt and we want to upload it in test folder on webdav server, so our command would be: curl -T '/path/to/local/file.txt' '' CURL -Options:Ĭurl provides various options which makes our life easier. To create new directory on webdav server use -X MKCOL request: curl -X MKCOL ''įor uploading file on webdav server use PUT request. Let's say we wanna rename old.txt to new.txt: curl -X MOVE -header 'Destination:' '' Rename operation can be performed using -X MOVE request. In that case try renaming index file first. On few Webdav Servers, it is possible that curl -X DELETE command is not able to delete folder because of index.* file in that folder. Similarly for deleting file say test.txt: curl -X DELETE ''

Let's say we need to delete test folder on webdav server, so our command would be: curl -X DELETE '' Deleting Files/Folders on Webdav Server:įor deleting an existing file or folder on Webdav Server we need to send DELETE request followed by path to the folder/file of the webdav server.So, the command would be: curl ''Īlso Optionally, you can get response headers from the webdav server, based on which you can get to know about completion of the operation. Reading files or folders on Webdav Server is simply implementation of Curl Get request. Reading Files/Folders on Webdav Server:.Note: It is recommended to read article completely (both management and curl options) before implementation.
#WEBDAV CLIENT LINUX HOW TO#
I'll assume that you know how to execute 'curl' command using terminal and invoke 'curl -help' or 'curl -manual' to get basic information about it. While the second part of the post will cover implementation of Two Factor Authentication for the same. Curl is a command line tool for doing all sorts of URL manipulations and transfers, but this particular post will focus on how to use curl for managing (read/ delete/ rename/ upload) files on Webdav Server.
