Skip to content

data_uri not returning the correct base64 encoded data #44

Closed

Description

@yudho

data_uri method returns the base64 encoded version of something else, but not the blob/binary data.

Activity

  1. yudho commented on May 23, 2014

    @yudho
    ContributorAuthor

    I have fixed this in Pull Request #45
    Please merge that. Thank you.

  2. JudyWu commented on Oct 28, 2015

    @JudyWu

    When I called data_uri on the file, it returns this:

    "data:image/jpeg;base64,IzxNb25nb2lkOjpHcmlkRnM6OkZzOjpGaWxlOjB4MDAwMDAwMDJlMzFlMTA+"

    When I tried it on the browser, no image came out. Do you know what caused it or how I could fix it?

    Thank you very much!

  3. MarcoLosito commented on Nov 27, 2015

    @MarcoLosito

    Hi,
    I developed the same fix as yudho, please merge his code.

    Also other people found the same problem:
    http://stackoverflow.com/questions/33344217/cant-get-data-uri-working-in-mongoid-grid-fs-gem

  4. dblock commented on Oct 18, 2026

    @dblock
    Contributor

    The bug is reproduced and addressed by #87: Base64 must encode stored file data, not the model description. The fix includes binary round-trip and data URI regressions. Keeping this issue open until the PR merges.

    Posted by an AI on behalf of @dblock.

  5. dblock commented on Oct 18, 2026

    @dblock
    Contributor

    Fixed by #87, now merged. Base64 and data URIs encode the stored bytes rather than the model description. #89 additionally strengthens the binary regression to assert that the upload truly spans multiple chunks.

    Posted by an AI on behalf of @dblock.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions