Skip to content

Files, attachments, uploading #57

@joepio

Description

@joepio

Some data should not be structured in Atomic Data, but in some existing (binary) format. How should dealing with these files work in Atomic Data?

Some thoughts:

  • One option is to include the binary as Base64 in the Resources, but that would be very slow to parse / serialize. This might be a good idea for small files such as icons, but for everything else: no.
  • We could have a File Class that has a bunch of properties containing metadata, such as file title, size and mime type. This File could then link to the actual file URL.
  • We could host the File Resource on the same URL as the actual file itself, and use HTTP content negotiation to either open the file, or the metadata of the file. However, this might lead to weird UX: imagine opening a File resource in Atomic Data Browser, going to the URL, seeing a nice in-browser preview, then re-opening the page, and getting the full file instead of the metadata thing. Not great.
  • How does authorization work? If files themselves are resources, we could simply use existing Hierarchies. If the files exist as separate entities, how do we know what the rights are? Do they still have parents?

Classes

The File Class

A File can be any type of information object, such as an image, video, executable or zip file.
In Atomic Data, the actual resource that you want to download is seperate from the metadata.
The File Resource itself only contains the metadata, and links to the actual Resource.

Required:

  • filename
  • mimetype. Mimetype string, e.g. audio/mpeg (for MP3). Maybe replace this with the filetype prop, because that would resolve into something more human readable and complete.

Optional:

  • filetype. Links to a MimeType / FileType instance (see below)
  • ``

The Mimetype / filetype Class

A MimeType describes how a certian filetype should work.
Maybe we could import all the mime types and convert them to atomic data?
That way, all MIME types would be machine readable, which is pretty cool.
However, at this moment most MIME types seem to only be describes as plaintext resources.
https://github.com/jshttp/mime-db

Requires:

  • Mimetype string
  • URL of RFC
  • ?

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