1

I am trying to receive a file from the socket io server using socket.io-stream package. I receive a stream but how do I download that stream in a file. The file could be any format. Is there a way to do it as browser js does not have fs package. I was reading there could be a blob but not sure how to do it.

<script>
      $(function () {
        var socket = io();

        ss(socket).on('file', function(stream, data) {
          **//stream.pipe(fs.createWriteStream(filename));**
         });

      });
    </script>
Dee
  • 53
  • 7

0 Answers0