A
A
Artur Aralin2015-09-30 09:40:23
Node.js
Artur Aralin, 2015-09-30 09:40:23

How to send a file without saving it to disk?

Hey! I have the following task: I receive a file from a client like this:

methods.uploadPhoto = (req, res) => {
  req.pipe(req.busboy);
  req.busboy.on('file', (fieldName, file, fileName) => {
    
  })	
};

The question is: is it possible to send further without saving the file to disk?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
L
leninlin, 2015-09-30
@leninlin

As I understand it, filethis is a data buffer from a file. Here you throw it into the content of the request and send it further.

N
Nook Scheel, 2015-10-02
@inook

You need to use a Stream for input and output.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question