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
{{ message }}
Repository navigation
data_uri not returning the correct base64 encoded data #44
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.
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.
Activity
yudho commentedon May 23, 2014
I have fixed this in Pull Request #45
Please merge that. Thank you.
JudyWu commentedon Oct 28, 2015
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!
MarcoLosito commentedon Nov 27, 2015
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
dblock commentedon Oct 18, 2026
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.
dblock commentedon Oct 18, 2026
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.