balloon icon indicating copy to clipboard operation
balloon copied to clipboard

PUT /api/v2/files may only accept a json including the file upload session id

Open raffis opened this issue 6 years ago • 1 comments

Description

Is: There is not a proper way to send binary data and meta data except for query string params.

Should: /api/v2/files needs to accept a file session id to finish a file upload.

Introduce new api endpoints:

POST /api/v2/sessions GET /api/v2/sessions GET /api/v2/sessions/{session} DELETE /api/v2/sessions/{session} PATCH /api/v2/sessions/{session} PUT /api/v2/sessions/{session}

Session endpoints will replace PUT /api/v2/files and PUT /api/v2/chunk.

POST /api/v2/files PUT /api/v2/files/{file} PATCH /api/v2/files/{file}

will accept a new body attribute named session which holds the session id to store and finalize.

Note: /api/v2/sessions/{session} can still get patched to append data to a file. Similar to the chunking endpoint. Range xxxx- header may be used to specify what bytes should be updated or appended.

balloon server version

2.0.4

PHP version

Operating system

Webserver

raffis avatar Jul 11 '18 15:07 raffis

We may also introduce the tus protocol (https://github.com/ankitpokhrel/tus-php) but probably doesnt really fit well. There is too much specific stuff.

raffis avatar Oct 11 '19 06:10 raffis