Sending file to WebDav Server

Hi All,
I am using a webdav server

host name : abc.xyz.com.ak
username : user123
password  : password123
port : 80

I need to send files stored in my windows system to the server, any idea how to do it.
I dont know how to create a url in linux for webdav server using details.

Hi.

You should first try to formulate your own solution by attempting to write your own code based on your own ideas.

In addition, it is always best to show the details of your operating system as well.

Details matter.

Attempting your own solution first is critical.

Post your own ideas, your own code, sample input, output, including any and all error message you encounter (using code tags).

Looking forward to hearing back from you here.

You should now options enabled in your server endpoint, I used in past with nextcloud

Below few are examples, for authentication use -u user:pass

# to get options supported by your server
# output can be Allow: DELETE,MKCOL,PROPFIND,GET,HEAD,PROPPATCH,OPTIONS,MOVE,PUT,GET,HEAD
curl -i -X OPTIONS http://example.com

# To create folder
curl -X MKCOL 'http://example.com/webdav/new_folder'

# To delete folder
curl -X DELETE 'http://example.com/webdav/new_folder'

# To delete file
curl -X DELETE 'http://example.com/webdav/somefolder/somefile.txt'

# To upload file
curl -T '/path/to/local/file.dat' 'http://example.com/webdav/somefolder/somename.dat'

Examples Demo Here

$ curl -i -X OPTIONS https://www.webdavserver.com/Userf7f3492
HTTP/1.1 200 
Set-Cookie: JSESSIONID=AE4266FF2F7C7AF69529A20E81F10BF7; Path=/; Secure; HttpOnly
X-Engine: IT Hit WebDAV Server v4.3.3515 (Evaluation License)
Access-Control-Allow-Origin: *
Access-Control-Allow-Credentials: true
Access-Control-Allow-Methods: PROPFIND, PROPPATCH, COPY, MOVE, DELETE, MKCOL, LOCK, UNLOCK, PUT, GETLIB, VERSION-CONTROL, CHECKIN, CHECKOUT, UNCHECKOUT, REPORT, UPDATE, CANCELUPLOAD, HEAD, OPTIONS, GET, POST
Access-Control-Allow-Headers: Overwrite, Destination, Content-Type, Depth, User-Agent, Translate, Range, Content-Range, Timeout, X-File-Size, X-Requested-With, If-Modified-Since, X-File-Name, Cache-Control, Location, Lock-Token, If
Access-Control-Expose-Headers: DAV, content-length, Allow
Access-Control-Max-Age: 2147483647
DASL: <DAV:basicsearch>
DAV: 1, 2, 3, resumable-upload, paging
Allow: OPTIONS, PROPFIND, PROPPATCH, COPY, MOVE, DELETE, MKCOL, LOCK, UNLOCK, SEARCH
Public: OPTIONS, PROPFIND, PROPPATCH, COPY, MOVE, DELETE, MKCOL, LOCK, UNLOCK, SEARCH
Accept-Ranges: bytes
MS-Author-Via: DAV
Content-Length: 0
Date: Thu, 30 Jan 2020 15:43:22 GMT

curl -i -X MKCOL https://www.webdavserver.com/Userf7f3492/testabc
HTTP/1.1 201 
Set-Cookie: JSESSIONID=F91D6FE1A7D529E1FCDFAA89C4149015; Path=/; Secure; HttpOnly
X-Engine: IT Hit WebDAV Server v4.3.3515 (Evaluation License)
Access-Control-Allow-Origin: *
Access-Control-Allow-Credentials: true
Access-Control-Allow-Methods: PROPFIND, PROPPATCH, COPY, MOVE, DELETE, MKCOL, LOCK, UNLOCK, PUT, GETLIB, VERSION-CONTROL, CHECKIN, CHECKOUT, UNCHECKOUT, REPORT, UPDATE, CANCELUPLOAD, HEAD, OPTIONS, GET, POST
Access-Control-Allow-Headers: Overwrite, Destination, Content-Type, Depth, User-Agent, Translate, Range, Content-Range, Timeout, X-File-Size, X-Requested-With, If-Modified-Since, X-File-Name, Cache-Control, Location, Lock-Token, If
Access-Control-Expose-Headers: DAV, content-length, Allow
Access-Control-Max-Age: 2147483647
Content-Length: 0
Date: Thu, 30 Jan 2020 15:44:48 GMT


2 Likes