Subject: COPY: "Duplicate" functionality

From: Graham Leggett <[email-masked]>
Date: Mon, 31 Oct 2016 19:49:49 +0200

Hi all,

According to https://tools.ietf.org/html/rfc4918#section-9.8, the COPY method allows me to make a copy of a resource, but only as long as I know the destination URL of my copy: "The Destination header MUST be present.”.

What I need to implement is functionality that matches the “Duplicate” menu item in the MacOS Finder. In other words, I want to make a copy of an URL, but I want the server to decide on the URL to the COPY.

Is this possible while at the same time being RFC compliant?

If I was to set the Destination header to the same URL as the source, or perhaps the parent collection of the source, would that make sense?

Regards,
Graham
—

---

From: Julian Reschke <[email-masked]>
Date: Mon, 31 Oct 2016 19:10:21 +0100

> If I was to set the Destination header to the same URL as the source, or perhaps the parent collection of the source, would that make sense?

Well, there is no standard functionality for that. You can sure 
experiment if you control both client and server (I'd probably try 
"path/*" as destination URI).

Best regards, Julian

---

From: ChanMaxthon <[email-masked]>
Date: Tue, 01 Nov 2016 13:18:25 +0800

I think you can generate a name, HEAD it, and then COPY it if you get a 404.

Sent from my iPhone

> On Nov 1, 2016, at 02:10, Julian Reschke <[email-masked]> wrote:
> 
> Well, there is no standard functionality for that. You can sure experiment if you control both client and server (I'd probably try "path/*" as destination URI).
> 
> Best regards, Julian
> 
>