Answer the question
In order to leave comments, you need to log in
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
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
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 questionAsk a Question
731 491 924 answers to any question