P
P
pavelblog2020-08-28 11:23:59
webdav
pavelblog, 2020-08-28 11:23:59

How to copy a file available via http to a webdav server without downloading it to your computer?

The point is this.
There is a file located on the website at site.ru/file.txt.
There is a webdav server (for example, a Yandex disk) to which I want to download the file.txt file, without downloading it to my computer.
Tried to do like this:

curl -u $auth -X COPY -H 'Destination: $durl' $rurl

But in response I get 405 Not Allowed, both on my own webdav server and on Yandex disk.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Dimonchik, 2020-08-28
@dimonchik2013

means Not Allowed
webdav is waiting for a set of bytes - the body of the file, it does not know how to do it differently

V
Vladimir Korotenko, 2020-08-28
@firedragon

The answer to your question is in the question itself. You create 2 clients, the first one downloads, the second uploads, you set the volume of the intermediate buffer yourself. In theory, the same curl allows you to direct the stream to stdout using pipe, you can send its output to the input stream of another program. By the way, in ftp there is an output switch command when the client tells server b to download a file from server a

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question