Thelounge: Include image/file upload functionality

Created on 1 Nov 2017  路  5Comments  路  Source: thelounge/thelounge

This is just a feature I was thinking about that would be nice to have as things like discord, slack and irccloud have this build in.

There are several ways I see how this can work depending on how complete we want to make this.

  1. Make lounge its own file host where the upload functionality uploads it internally and also serves.
  2. Use third part content hosters like imgur for images, github gist for code snippets, pastebin, etc.
  3. Allow people to define custom uploaders, similary to how the screenhot application ShareX does this

Option 1. would be pretty cool but expands the scope of the lounge and comes with various issues regarding privacy (people might run the lounge on their home network) and hosting capacity (image urls might be reshared and get really popular taking down the user's lounge machine).

Option 2. would probably be the most trivial one to implement if it is simply anonymous uploads. This leaves people without the option to delete whatever they uploaded which would complicate the implementation somewhat and will add additional settings.

Option 3. is the most flexible of the three however will make things complicated for the user.

As far as the UI/UX goes in the most simple form it would simply be an upload icon where the destination is determined on the filetype and that on success returns the url in the input textarea.

A nice UX touch could be to offer to upload user input to gist/pastebin when someone writes a very long piece of text. This is something that irccloud does and allows for very easy code sharing.

Feature

Most helpful comment

So, we do serve images from the lounge, as we cache preview images now, so we can use that.

I would suggest:

  1. Built-in support only works with uploading to our internal storage and serving the same way. This will work for most people, and gives "normal" people the simplicity of it
  2. Add plugin support for custom uploaders. Someone could make a plugin for imgur if they wanted, someone could make a plugin for allowing people to upload to their own servers. This gives people the ability to do all the custom stuff they want.

Having the 2 of these would be the best of both worlds. We should start off with just 1 and eventually do 2.

Similarly, we should probably start off with only supporting uploading images as that's simplest and takes least security thoughts.

The gist idea is nice (I miss that from irccloud) but also brings in a few issues with making sure that we don't accidentally create XSS.

As far as the UI/UX goes in the most simple form it would simply be an upload icon where the destination is determined on the filetype and that on success returns the url in the input textarea.

Also, drag/drop onto chat would be nice.

All 5 comments

So, we do serve images from the lounge, as we cache preview images now, so we can use that.

I would suggest:

  1. Built-in support only works with uploading to our internal storage and serving the same way. This will work for most people, and gives "normal" people the simplicity of it
  2. Add plugin support for custom uploaders. Someone could make a plugin for imgur if they wanted, someone could make a plugin for allowing people to upload to their own servers. This gives people the ability to do all the custom stuff they want.

Having the 2 of these would be the best of both worlds. We should start off with just 1 and eventually do 2.

Similarly, we should probably start off with only supporting uploading images as that's simplest and takes least security thoughts.

The gist idea is nice (I miss that from irccloud) but also brings in a few issues with making sure that we don't accidentally create XSS.

As far as the UI/UX goes in the most simple form it would simply be an upload icon where the destination is determined on the filetype and that on success returns the url in the input textarea.

Also, drag/drop onto chat would be nice.

I loved how it worked in irccloud. Image in clipboard paste in textinput on chatclient and it posts a link to the image.

yeah doing 1 first and then 2 eventually makes the most sense.

Also, drag/drop onto chat would be nice.

Yeah there are a few things people are used to I guess.

  • upload button, next to the input.
  • drag and drop, doing it on the channel + input makes sense here.
  • When pasting with an image on clipboard. Something to take into consideration is if this should be done only when the input has focus or just always. Both make sense.

I agree with pretty much everything that was said here.

The only implementation detail I would add, and it doesn't have to be that way at first try, is that eventually I think TL should "simply" define an upload file API, and built-in upload to our internal storage would simply be a built-in package that dogfoods that API.

Then as said anyone can come up with packages for imgur or whatnot that consume that same API.

Re: UX, also agreed with all: upload button, drag-and-drop, copy/paste. Not all have to come with first implementation, we can start with simple button and add the others later if that makes it easier to code/review/merge.

Surprised we didn't have an issue for this already, thanks for opening it!

Added in #2552, disabled by default and will require further UX work. But the actual ability to upload files and link them is there.

Was this page helpful?
0 / 5 - 0 ratings