http-extensions icon indicating copy to clipboard operation
http-extensions copied to clipboard

Media type for Upload Appending Procedure

Open Acconut opened this issue 1 year ago • 3 comments

During IETF 117, it was noted that PATCH requests need to specify some media type, so our Upload Appending Procedure needs one as well. This could either be one from the byte range draft (#2501) or a custom one. For example, in the tus uploading protocol we use the content type application/offset+octet-stream to indicate that it is an undefined byte sequence that should be applied at a specific offset (as defined in the request).

Acconut avatar Aug 03 '23 15:08 Acconut

I looked through the list of registered media types (https://www.iana.org/assignments/media-types/media-types.xhtml) to find if there is a media type that represents a file chunk without any additional metadata.

There is message/partial, but as far as I understand, it is meant for chunks of e-mail messages specifically, meaning it not suitable for chunks of files, in general.

Is there anybody aware of another existing media type? If not, we can propose registering application/offset+octet-stream or just going with application/octet-stream.

Acconut avatar Nov 06 '23 17:11 Acconut

Is there anybody aware of another existing media type? If not, we can propose registering application/offset+octet-stream or just going with application/octet-stream.

application/octet-stream is too generic and does not describe the patch document properly. application/offset+octet-stream does not fit because the suffix (delimited by the + has a specific meaning for MIME types).

How about a dedicated application/upload-chunk or application/partial-upload media type? It would mean that the corresponding content is a consecutive, partial chunk of an upload. In the draft we can then define that an upload resource can apply such a patch document by appending the data to the file on the server.

The IANA registry of media types already includes a similar media type in the vendor tree from Adobe for use in one of their web applications: application/vnd.adobe.partial-upload

Acconut avatar Feb 26 '24 18:02 Acconut

My two cents: I would avoid the word "chunk" as it's been a source of confusion in tus. There is ambiguity if it refers to part of the upload, a whole request (containing parts of the file and not the whole thing), part of the content of the request etc.

smatsson avatar Feb 27 '24 12:02 smatsson