Closed akellorich closed 6 years ago
Hi Can you post the code, so that I can see what is happening. You can also give some url, where I can see code like jsfiddle etc.
Hi uUjjwal, what is the datatype for storing a long base64 string like this: data:image/jpeg;base64,/9j/4AAQSkZJRgABAgEAYABgAAD/7gAOQWRvYmUAZAAAAAAB/+EN/kV4aWYAAE1NACoAAAAIAAgBMgACAAAAFAAAAG4BOwACAAAACwAAAIJHRgADAAAAAQAFAABHSQADAAAAAQBYAACCmAACAAAAFgAAAI2cnQABAAAAFgAAAADqHAAHAAAHogAAAACHaQAEAAAAAQAAAKMAAAENMjAwOTowMzoxMiAxMzo0ODozMgBUb20gQWxwaGluAE1pY3Jvc29mdCBDb3Jwb3JhdGlvbgAABZADAAIAAAAUAAAA5ZAEAAIAAAAUAAAA+ZKRAAIAAAADNzcAAJKSAAIAAAADNzcAAOocAAcAAAe0AAAAAAAAAAAyMDA4OjAyOjExIDExOjMyOjUxADIwMDg6MDI6MTEgMTE6MzI6NTEAAAUBAwADAAAAAQAGAAABGgAFAAAAAQAAAU8BGwAFAAAAAQAAAVcCAQAEAAAAAQAAAV8CAgAEAAAAAQAADJcAAAAAAAAASAAAAAEAAABIAAAAAf/Y/+AAEEpGSUYAAQEAAAEAAQAA/9sAQwAQCwwODAoQDg0OEhEQExgoGhgWFhgxIyUdKDozPTw5Mzg3QEhcTkBEV0U3OFBtUVdfYmdoZz5NcXlwZHhcZWdj/9sAQwEREhIYFRgvGhovY0I4QmNjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2NjY2Nj/8AAEQgAeACgAwEiAAIRAQMRAf/EAB8AAAEFAQEBAQEBAAAAAAAAAAABAgMEBQYHCAkKC//EALUQAAIBAwMCBAMFBQQEAAABfQECAwAEEQUSITFBBhNRYQcicRQygZGhCCNCscEVUtHwJDNicoIJChYXGBkaJSYnKCkqNDU2Nzg5OkNERUZHSElKU1RVVldYWVpjZGVmZ2hpanN0dXZ3eHl6g4SFhoeIiYqSk5SVlpeYm[…]
Actually it's longer than that
Or rather how can I emulate BLOB datatype in JsStore
Yes it will be better to save file as a blob. I have not added the blob type, so don't specify the data type for now. It should work and you will be able to save the file as a blob.
I will add the blob DataType. Let me know if your code is working or not.
So what do I put as the datatype for the column?
Thanks
DataType is optional, so you can remove it. When you mention datatype - it validates the data for the datatype when you insert or update.
Checkout these two links: Storing image as blob and Storing image as string
Hopefully this will help you
closing - hope the above answer is helpful for you.
if you are using blob to store images then datatype will be 'object'.
Hello, I have a base64 string want to save in the db, have tried using the object datatype but gives an error incorrect datatype provided for the column, when I use string datatype the base64 string is trimmed hence cannot be converted to back to an image. How do I go about this
Thanks