mongoid / mongoid-grid_fs

A pure Mongoid/Moped implementation of the MongoDB GridFS specification.
Other
83 stars 50 forks source link

data_uri not returning the correct base64 encoded data #44

Open yudho opened 10 years ago

yudho commented 10 years ago

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

yudho commented 10 years ago

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

JudyWu commented 9 years ago

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 commented 8 years ago

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