J
J
Jundallah2019-08-07 21:35:56
Django
Jundallah, 2019-08-07 21:35:56

How to save files in an unsent message?

Good evening. Despite the tags, the question is pretty general. I would like to make a chat, the essence is this: the user can send files to the message, which, before sending the message, are sent in advance by the put method to the server, where they are saved. Roughly speaking, there is no message yet, and the files should already be attached to it. Question: how to bind files to an unsent message?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
adam_carraway, 2019-08-07
@adam_carraway

Just upload the file to the server via ajax, remember the path to it in the variable, and if the user sends a message, but when creating it, just add the file path. as an option

S
Stanislav Silin, 2019-08-07
@byme

Make a draft message before sending and save it on the server. It will contain the text entered by the user and files. When the user wants to send a message, then create a message based on a draft.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question