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

File sharing #1

Open
poga opened this issue Aug 6, 2019 · 2 comments
Open

File sharing #1

poga opened this issue Aug 6, 2019 · 2 comments
Labels
good first issue Good for newcomers help wanted Extra attention is needed

Comments

@poga
Copy link
Contributor

poga commented Aug 6, 2019

Currently, we only support text-based(text, action) messages. Although we can easily support file sharing via putting files into hyperdrive. There're some concerns:

  • The performance impact of storing large binary blob in a merkle-log
  • Operation: Storing large file on local disk increases operation burden.
  • There're already many great platforms for sharing static files, such as BitTorrent, IPFS.

For simplicity sake, we can provide a simple "upload to BT/IPFS/S3" middleware and save the signed URL to the hyperdrive for now.

@poga poga added the enhancement New feature or request label Aug 6, 2019
@poga poga modified the milestone: Beta Release Aug 6, 2019
@poga poga removed the enhancement New feature or request label Aug 12, 2019
@poga poga added good first issue Good for newcomers help wanted Extra attention is needed labels Dec 9, 2019
@poga
Copy link
Contributor Author

poga commented Dec 9, 2019

The simplest way to do this might be with postToTopic in the frontend. We can post a new message to the topic with type = 'blob' and value = base64(blob).

pros:

  • pure frontend solution, no new API needed
  • Simple to implement

cons:

  • everyone in channel will download the whole file instantly, wasting bandwidth.

@poga
Copy link
Contributor Author

poga commented Feb 11, 2020

Preliminary support for file upload is implemented in #13.

However, it directly embed file blob into chat history. All uploaded files will be downloaded when user open the chat. This severely impact performance.

A proper way would be upload file to an external storage and only the save url in PTT.ai

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant