NIP-96: no transform (#1262)

* no_transform

* Update 96.md

Co-authored-by: Santos <34815293+sant0s12@users.noreply.github.com>

---------

Co-authored-by: Santos <34815293+sant0s12@users.noreply.github.com>
This commit is contained in:
Kieran 2024-05-27 14:52:49 +01:00 committed by GitHub
parent bd9c7a1b8e
commit 17593a41ab
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

3
96.md
View File

@ -101,6 +101,7 @@ List of form fields:
- `alt`: **RECOMMENDED** strict description text for visibility-impaired users. - `alt`: **RECOMMENDED** strict description text for visibility-impaired users.
- `media_type`: "avatar" or "banner". Informs the server if the file will be used as an avatar or banner. If absent, the server will interpret it as a normal upload, without special treatment. - `media_type`: "avatar" or "banner". Informs the server if the file will be used as an avatar or banner. If absent, the server will interpret it as a normal upload, without special treatment.
- `content_type`: mime type such as "image/jpeg". This is just a value the server can use to reject early if the mime type isn't supported. - `content_type`: mime type such as "image/jpeg". This is just a value the server can use to reject early if the mime type isn't supported.
- `no_transform`: "true" asks server not to transform the file and serve the uploaded file as is, may be rejected.
Others custom form data fields may be used depending on specific `server` support. Others custom form data fields may be used depending on specific `server` support.
The `server` isn't required to store any metadata sent by `clients`. The `server` isn't required to store any metadata sent by `clients`.
@ -110,6 +111,8 @@ The hash is enough to uniquely identify a file, that's why it will be used on th
The `server` MUST link the user's `pubkey` string as the owner of the file so to later allow them to delete the file. The `server` MUST link the user's `pubkey` string as the owner of the file so to later allow them to delete the file.
`no_transform` can be used to replicate a file to multiple servers for redundancy, clients can use the [server list](#selecting-a-server) to find alternative servers which might contain the same file. When uploading a file and requesting `no_transform` clients should check that the hash matches in the response in order to detect if the file was modified.
### Response codes ### Response codes
- `200 OK`: File upload exists, but is successful (Existing hash) - `200 OK`: File upload exists, but is successful (Existing hash)