Uploaded image for project: 'Go Driver'
  1. Go Driver
  2. GODRIVER-1548

Access filename and metadata in gridfs DownloadStream

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.4.0
    • Component/s: GridFS
    • Security Level: Public
    • Labels:
      None
    • Backwards Compatibility:
      Fully Compatible

      Description

      The api for gridfs does not give you access to the filename or metadata of a file when downloading it even though internally it fetches the file document. I propose adding fields or methods to access these on `DownloadStream` and internally just linking up to the file document which is already fetched. This would prevent user libraries from having to implement this and also from having to redundantly lookup the file document(ie read from the db again).

      Our app uses file ids to lookup files but we use the name and metadata(contenttype stored here) to provide a more friendly url to the user. While upgrading from globalsign/mgo I found that the gridfs implementation here doesn't give you any way to read file names or metadata easily. Right now you have to hack around it by fetching the file again and decoding it yourself.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              divjot.arora Divjot Arora
              Reporter:
              epelc@greatcloak.com Ed Pelc
              Participants:
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: