You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
My app receives a stream socket.io-stream which is emitted at browser and writes to a file using fs. Stream content is binary. But instead of writing to file I want to upload to box.com via their sdk which requires a readstream.
I have tried to use the socket stream directly to sdk upload method but it fail. The sdk upload method only works with fs.createReadStream method.
I need to know with the duplexify pack whether I can create a duplex stream which reads from socket io stream and outputs to box upload sdk?
Thanks
The text was updated successfully, but these errors were encountered:
ss(socket).on('file', (stream, data) => {
console.log('>>>Received File Emit at <<<', new Date().toString());
console.log('data.originalName', data.originalName);
var streamFileName = Date.now() + '.txt';
//saving to stream to file
// stream.pipe(fs.createWriteStream( streamFileName ));
// I don't want rather use the "stream" down below in the uploadFile function
// var stream = fs.createReadStream('/path/to/file'); works but the above incoming stream doesn't
boxApiClient.files.uploadFile('36155801746', data.originalName, stream, (err) => {
if (err) {} else {
console.log('Upload to box finished');
}
});
My app receives a stream socket.io-stream which is emitted at browser and writes to a file using fs. Stream content is binary. But instead of writing to file I want to upload to box.com via their sdk which requires a readstream.
I have tried to use the socket stream directly to sdk upload method but it fail. The sdk upload method only works with fs.createReadStream method.
I need to know with the duplexify pack whether I can create a duplex stream which reads from socket io stream and outputs to box upload sdk?
Thanks
The text was updated successfully, but these errors were encountered: