Skip to content
Advertisement

Sending file to WebDav server using PHP curl

I am trying to send file to the webDav server using curl. My code is working fine but the problem i am facing is curl -T is deleting all the existing file in network. Is there any other flag which can only send one file and donot touch other files in a network.

exec('curl -T "' . $src . $file . '" ' . $full_url . str_replace(' ', '', $upDir) . str_replace(' ', '', $file));

Thanks in advance

Advertisement

Answer

You can use this code to send file using curl. Make sure you use CURLFile class.

JavaScript
User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement