Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Media Endpoint Uploader #22

Open
EdwardHinkle opened this issue Jun 10, 2019 · 0 comments
Open

Media Endpoint Uploader #22

EdwardHinkle opened this issue Jun 10, 2019 · 0 comments
Assignees
Labels
Milestone

Comments

@EdwardHinkle
Copy link
Owner

EdwardHinkle commented Jun 10, 2019

There should be an easy function to call with a file or reference to a file that will upload that file to the Media Endpoint.

It should also integrate with #12 so that you can start uploading files and trigger the Micropub Request and the request will wait until these uploads are complete

3.6.2 Authentication
The Media Endpoint must accept the same access tokens that the Micropub endpoint accepts.

3.6.3 Request
To upload a file to the Media Endpoint, the client sends a multipart/form-data request with one part named file. The Media Endpoint may ignore the suggested filename that the client sends.

3.6.4 Response
The Media Endpoint processes the file upload, storing it in whatever backend it wishes, and generates a URL to the file. The URL should be unguessable, such as using a UUID in the path. If the request is successful, the endpoint must return the URL to the file that was created in the HTTP Location header, and respond with HTTP 201 Created. The response body is left undefined.

The Micropub client can then use this URL as the value of e.g. the "photo" property of a Micropub request.

The Media Endpoint may periodically delete files uploaded if they are not used in a Micropub request within a specific amount of time.

3.6.4.1 Media Endpoint Error Response
The Media Endpoint should follow the same conventions for returning error responses as the Micropub endpoint, described in Error Response.

https://micropub.net/draft/#media-endpoint

@EdwardHinkle EdwardHinkle added this to the 1.0.0 milestone Jun 10, 2019
@EdwardHinkle EdwardHinkle self-assigned this Jun 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant