L
L
lyrion2020-04-25 18:38:10
Node.js
lyrion, 2020-04-25 18:38:10

How to transfer files from server to client?

Comrades, please don’t throw slippers, I’m a full boot in the backend area)
There is the following situation: there should be a download of audio recordings on the client, when the user clicks, the file starts downloading to the PC. There are no records on the server (the server is on express), direct links cannot be given. When you click on the server, the record identifier goes away, which is passed to a third-party script launched through child_process, this process starts downloading the record and then puts it along the specified path (download time can be long, up to a minute).
I can send jsons back and forth, but I have no idea how to send a file. Please tell me what to read, but rather working examples of such a concept.
Ps I understand the speech about streams and sockets very conditionally and, unfortunately, there is not much time to get a grasp of the theory right now =/
Thanks in advance for your reply ;-)

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question