Uploaded image for project: 'Node.js Driver'
  1. Node.js Driver
  2. NODE-2050

GridFS Bucket openDownloadStream

    • Type: Icon: Bug Bug
    • Resolution: Works as Designed
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 3.2.4
    • Component/s: None
    • Environment:
      nodejs, no mongoose, no transpiling

      Hi,

      I'm using mongodb's node.js driver in my project for streaming GridFS multimedia files on the browser.

      I've notice that from version 3.2.4 to the actual (3.2.7) there is probably an issue in the openDownloadStream function passing start and end parameters.

      As you maybe know the browser (Safari, Chrome) ask con content range request so, from express is necessay to respond with 206 and provide information about the actual streamed content and use res.write(chunk).

      It seems that from the 3.2.4 version there is an issue in the end of file write from the openDownloadStream function.

      Below the output with 3.2.3 driver version in chunked file stream (the file is 25588946 bytes size)

      headers bytes=0-1
      headers bytes=0-65535
      headers bytes=65535-25588945

      from 3.2.4 version the output is this

      headers bytes=0-
      headers bytes=25588945-
      headers bytes=25588945-
      headers bytes=25588945-
      headers bytes=25588945-
      headers bytes=25588945-
      headers bytes=25588945-
      headers bytes=25588945-
      headers bytes=25588945-
      headers bytes=25588945-
      headers bytes=25588945-
      headers bytes=25588945-
      headers bytes=25588945-
      headers bytes=25588945-
      headers bytes=25588945-
      headers bytes=25588945-
      headers bytes=25588945-
      headers bytes=25588945-
      headers bytes=25588945-
      headers bytes=25588945-
      headers bytes=25588945-
      headers bytes=25588945-
      headers bytes=25588945-
      headers bytes=25588945-
      headers bytes=25588945-
      headers bytes=25588945-

       

      the latest byte of the file and the file play freeze

      Please let me know if is something wrong from me or if you need further info

      Best regards

      Enrico

        1. gfs.js
          5 kB
          peel70
        2. main.js
          6 kB
          Neal Beeken

            Assignee:
            neal.beeken@mongodb.com Neal Beeken
            Reporter:
            enrico.pelo@fastwebnet.it Enrico Pelo
            Votes:
            2 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: