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

FIXME: allow multiple files in content #8

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

milahu
Copy link
Contributor

@milahu milahu commented Jun 21, 2023

currently, content can hold only one file, usually utf8-encoded text.

it would be nice to send multiple files per event, for example:

  • text with images
  • text with video
  • video with subtitles
  • arbitrary folders of files

benefits:

  • avoid sending images as base64
  • reuse one image in multiple places
  • avoid muxing streams into one video file
  • avoid workarounds like zip-archives

this would make nostr more similar to bittorrent/zeronet/twister

@dr-orlovsky
Copy link
Contributor

I think multiple files can be packed as a tar package

@milahu
Copy link
Contributor Author

milahu commented Jun 26, 2023

at least we should add a content type, so users can describe the payload type.
how about:

  • enum values from 1 to 255 = some commonly used mimetypes:
    • text/markdown; charset=utf8
    • text/html; charset=utf8
    • application/zip; charset=binary
    • application/tar; charset=binary
    • application/tar; charset=binary+application/gzip; charset=binary
    • application/x-7z-compressed; charset=binary
  • value 0 + length-prefixed utf8-string (max 255 bytes length) = custom mimetype

@dr-orlovsky
Copy link
Contributor

I am not a big fan of something non-standard; the selection of 255 "common" types looks too opinionated for me...

We can allow MIME / MediaType in string representation - that is better (in binary serialization the string prefixed with one byte length).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants