(chunk, _encoding, callback)
| 211 | const fileStream = createReadStream(names[0]); |
| 212 | const counter = new Transform({ |
| 213 | transform(chunk, _encoding, callback) { |
| 214 | uploadProgress.bytesUploaded += chunk.length; |
| 215 | uploadProgress.emit('progress'); |
| 216 | callback(null, chunk); |
| 217 | }, |
| 218 | }); |
| 219 | fileStream.on('error', err => counter.destroy(err)); |
| 220 | counter.on('close', () => fileStream.destroy()); |