Sending file to WebDav Server


Login or Register for Dates, Times and to Reply

 
Thread Tools Search this Thread
Top Forums Web Development Sending file to WebDav Server
# 1  
Sending file to WebDav Server

Hi All,
I am using a webdav server
Code:
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.

Last edited by vbe; 4 Weeks Ago at 10:14 AM..
# 2  
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.
# 3  
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

Code:
# 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
Code:
$ 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


Last edited by Akshay Hegde; 2 Weeks Ago at 12:45 PM..
These 2 Users Gave Thanks to Akshay Hegde For This Post:
Login or Register for Dates, Times and to Reply

Previous Thread | Next Thread
Thread Tools Search this Thread
Search this Thread:
Advanced Search

Test Your Knowledge in Computers #870
Difficulty: Medium
Lisp introduced the concept of automatic garbage collection.
True or False?

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Perl: Sending file from UNIX server to Windows server

I'm trying to write a Perl script where a file from a UNIX server box connects to a Windows server box and copies that file into the Window box. The main problem I have right now is that whenever I try to connect to the Windows box, the connection is refused. The error message that always pops... (2 Replies)
Discussion started by: kooshi
2 Replies

2. Shell Programming and Scripting

Sending a file to 24 Server locations parallely

Hi All, I have to send a processed file to 24 different server locations. I feel, if this job can be done parallel in the background - Time will come down. I found the script to FTP the file for a single server location through past Unix posts as below: #!/usr/bin/ksh ftp -v -n... (16 Replies)
Discussion started by: vsmeruga
16 Replies

3. Shell Programming and Scripting

Perl and sending file to server

Hi, I am trying to write some test code for bigger project where my perl script will send file over to server. This is the current SERVER and CLIENT code I have so far. When I type "hi" from client I get hello back from server and like wise I send send command I get respond back the problem... (1 Reply)
Discussion started by: Dabheeruz
1 Replies

4. Solaris

Sending a file to a server

Dear Experts, please help i am very much confused here and not getting the right path, actually i want to send a file from client to a server, initially i used mmap() which is failing most of the time so i want to use general IO streams to do that, i can open a file in "rb" mode and read... (1 Reply)
Discussion started by: vin_pll
1 Replies

5. Shell Programming and Scripting

upload file to webdav server

Hi all i have a such question this is my shell script my script must upload file to webdav server ////////////////////////////////////////////////////////////////////////////////////////////////////////////// #!/bin/sh ###... (1 Reply)
Discussion started by: knut
1 Replies

6. UNIX for Dummies Questions & Answers

WebDav/davfs mounted file & directory names in all UPPERCASE

Hey, I have a WebDav directory mounted and everything seems fine except for one thing. All file/directory names appear in all UPPERCASE, when in actual fact they are lowercase on the remote machine. For example: foo/bar/baz.html on the remote host, appears on my local machine as... (0 Replies)
Discussion started by: MrMoney
0 Replies

7. Programming

Sending mail in C/C++ in unix server

Hi Frnds, I have a task in my project wherein i have to send out a mail from my C++ code.With some file attachements.Please help me in this. At a higher level wat i can tell is my code generated 3 csv file and i have to send these files as attachement. My code is executed in unix... (6 Replies)
Discussion started by: electroon
6 Replies

8. Programming

sending file from server to client

hi dear i m very new to socket programing . i need the source code which sends file from server to client . i mean both server n client programe which sends file . can u do this for me please my email id is email id removed regards bilal (1 Reply)
Discussion started by: bilal
1 Replies

9. Shell Programming and Scripting

FTP script for sending a file from one unix directory to another unix server director

Hi, My local server is :/usr/abcd/ Remote server is :/Usr/host/test/ I want to send files from local unix directory(All files starting with O_999) to remote host unix directory. Can any body give me the Unix Shell script to do this. One more doubt: Shall we need to change the file... (1 Reply)
Discussion started by: raja_1234
1 Replies

Featured Tech Videos