Answer the question
In order to leave comments, you need to log in
Is it safe to store and display images in base64?
I am currently writing a wysiwyg editor based on Quill.js. It has the ability to add images from the computer, which are encoded in base64 and inserted into the img tag. How safe is it to store images in base64 in a database (postgres) and also display them to a user on a website? Googling a bit, I found out that the base64 alphabet is limited, which makes sql injection and xss impossible, is that correct?
Answer the question
In order to leave comments, you need to log in
If the pictures are small, then you can store them in base64. If they are ordinary or large, then you should not store them in base64, they will take up more space than if stored in files, and all this will have to be given to the user with each request (the cache will not work on them).
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question