luiseduardobrito/sample-chat-electron

File Sharing

oxhey opened this issue · 3 comments

oxhey commented

How easy would it be to add file transfer to this?

Depends on how the transfer would take place.

1 - Indirect Transfer (Hosting the files in the cloud)

This is the basic approach, using some cloud provider such as Amazon S3, perform a simple web upload directly to a S3 Bucket. Then, you'll get a link to share with your friend, just post it automatically in the chat.

Some materials I found in a simple search.

2 - Direct Transfer (Peer to Peer)

To make it work without storing the file in a server-side sollution, I strongly suggest using some existing technology in the background such as WebRTC. This is already well tested, and quite popular in the NodeJS community with projects as WebTorrent and its core modules.

3 - Hardcore Mode (Transfer using Socket.io)

You can also send using nothing but socket.io, but I think this may be quite painful, specially if you have Mobile integration in your roadmap. It's elegant, use a single protocol to send them all, and is available in the community, but I would not start here.

oxhey commented

Thanks. I think the first option would be the easiest for me. I have a normal server so I will need to find a way of doing it without using AS3 .

Put this in the Roadmap, feel free to send a Pull Request if you want to do it!