I'm developing a chat application in Django and I want to share files through django channels. I just found some solutions that are based on this topic, but all are incomplete. So please help me for figure it out. Now I'm sending messages like the below mentioned code..
document.querySelector('#chat-message-submit').onclick = function(e) {
let msg = $('#chat-message-input').val()
var messageInputDom = document.querySelector('#chat-message-input');
var message = messageInputDom.value;
chatSocket.send(JSON.stringify({
'command':'new_message',
'message': message,
'from': username,
}));
messageInputDom.value = '';
}