For AI agents: Find a documentation index at https://talkjs.com/llms.txt (full content at https://talkjs.com/llms-full.txt). Get a markdown version of any page by appending .md to its URL path.

File sharing

Control whether and what file types users can share.

View as Markdown

You control whether users can share files in your chat, and which types of file extension they can share.

Enable file sharing

To allow your users to share files, go to the Chat UI page in the TalkJS dashboard. In the 'Features' section, select the box 'Allow file sharing'.

Overview of chat UI feature options, including a checkbox with the label 'Allow file sharing'.

All files that users share are securely saved in the TalkJS database. In some cases file sharing requires the user's permission. User permissions require no extra code or work from your side.

When file sharing is enabled, a user can share a file in the chat by pressing the paperclip icon in the message field. You can try it out here:

If you're using the Flutter SDK and are targeting Android, check out the Enable file sharing guide to support this.

Review files before sending

Users can change the selection of what files they'd like to send in the file upload preview that shows up before sending. To add more files, a user selects the + button next to the thumbnails. To take a file out, they can select the file and choose Remove. Removing the last file closes the preview.

Each file starts uploading when it's added, and Send becomes available once all files have uploaded.

An upload preview showing a selected image with its file name and a 'Remove' button below it. Underneath is a row of file thumbnails, a plus button for adding files, and 'Cancel' and 'Send' buttons.
Upload preview, with buttons to remove the selected file or add more files

Restrict file sharing

If you would like to allow file sharing only for one group of users but not others, you can do so by using roles. In your TalkJS dashboard, create a separate role for each user group and adjust the file sharing settings per role.

Allowed file extensions

By default, users can share files with the following extensions:

  • .7z
  • .aac
  • .ai
  • .aif
  • .aiff
  • .arj
  • .avi
  • .bmp
  • .bz2
  • .csv
  • .docx
  • .flac
  • .gif
  • .gz
  • .heic
  • .heif
  • .ics
  • .jpeg
  • .jpg
  • .lha
  • .log
  • .m4a
  • .md
  • .mid
  • .midi
  • .mkv
  • .mov
  • .mp3
  • .mp4
  • .mpeg
  • .oga
  • .ogg
  • .ogv
  • .opus
  • .pdf
  • .png
  • .pptx
  • .psd
  • .qt
  • .sit
  • .svg
  • .tar
  • .tif
  • .tiff
  • .ts
  • .txt
  • .wav
  • .webm
  • .xls
  • .xlsx
  • .zip

Is your preferred file extension missing from this list? Or would you like to disallow certain extensions? Get in touch and a member of the TalkJS team will get this sorted for you.