Skip to content

Missing guidance on uploading binary files #2

@a-akimov

Description

@a-akimov

At Monite, we provide an ability for customers to upload a binary file (e.g. a payable). Currently there is no information about this. Moreover, it's possible, that we should response with a binary data, along with the text.

Proposed solution

Response can be mixed, for example

{
    "files":
    [
        {
            "base64": "",
            "recognized_text": "",
            "data":
            {
                "provider": "",
                "amount": 0
            }
        }
    ]
}

Same to a payload. Instead of multipart, simple json:

{
    "file_base64": "",
    "account_number": "",
    "lalala": ""
}

However, why use JSON instead of multipart/form-data for file + data uploads? JSON payload would be 33% bigger due to the Base64 encoding. Multipart can contain both binary files and JSON data in separate parts.

Something to discuss and decide

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions