Is it possible to have image upload field, but instead of storing image as a file, I'd like to convert it to base64 encoded string and put it directly to the MongoDB.
How should one go about this ?
Storing images as base64 in the DB is not currently supported. Feel free to submit a feature request, so we can discuss/prioritize with everyone.
I'm not sure on the appetite of a feature like that getting into Payload core
It's likely possible to implement an adapter for
https://github.com/payloadcms/plugin-cloud-storagedepending on your skillset.
We just store it as string.. right now we ask the customer to convert manually and paste the string 😅😆 that should work right
I was thinking then of just creating a custom component that will handle the "upload* and conversion to b64
Yes, as long as you handle the conversion on your own 👍
Star
Discord
online
Get help straight from the Payload team with an Enterprise License.